1

I've have been trying for a while now, to implement a specific behavior in my app. On the initial view of my app, there must be a logo(imageView), a label and a textField. It should be possible to scroll down from the initial view, to a tableView. while the user scrolls down, the label in moved up in the window, to form a search field for the tableView. Then the scrollView should lock to the part with the tableView, and it should only be possible to scroll back up, if dragging elsewhere than the tableView.

What is best practice for doing as described?

The image show (only for illustration, i havn't been using story board when trying to implement it) an overview of the problem: scrollView with embedded tableView

The way I've tried to do this so far, is by embedding the tableView in a scrollView (as seen on image), enabling paging on the scrollView, and than disabling scrolling on the scrollView, when the buttom part has been reached. I've added a gesture reconizer on the part with of the screen with the textField.

These two posts (Scrollview with embedded tableview and Use Pan Recognizer to Control ScrollView) descripe i further detail what i've tried so far.

But the question is more to, is there an alternate solution for making behaviour descriped above?

Maybe interactive animated transitioning between view controllers somehow?

Community
  • 1
  • 1
Wiingaard
  • 4,150
  • 4
  • 35
  • 67

1 Answers1

0

YES there are! Implement a table view with a header view. And remove the scroll view.

self.tableView.tableHeaderView = topView

where topView will be the view wish as the UIImage, the label and textField

Nuno Vieira
  • 193
  • 2
  • 10