I have several views where I want the search bar to be hidden if the user doesn't scroll to use it. I use this command to achieve this:
[self.tableView setContentOffset:CGPointMake(0, 44) animated:NO];
This works fine, but it is not perfect; at any time something happens that causes the table view to reload, it needs to be moved again.
Now I have a view where I want to completely hide the search bar from the user, that is, they can’t even scroll down to get to it, but I want the area bars at the top of the table. So basically, I want to scroll the search bar from the top of the view and save it there, leaving the visible part of the visibility bar. setContentOffset no longer does this for me, as the user can easily undo it.
Is there an approach to this that I skip?
Thanks in advance!
Update: I never thought about that, so in the end I changed my design.
source share