In my app I have a search bar in the header of myUITableView
. I tried to set the content offset to my UITableView
for hiding the search bar but it is giving me some problems.
Finally I solved like this:
- (void)viewWillAppear:(BOOL)animated
{
[self performSelector:@selector(hideSearchBar) withObject:nil afterDelay:0.0f];
}
- (void)hideSearchBar
{
self.tblView.contentOffset = CGPointMake(0, 40);
}
The problem is it only works for iOS 8.
How can I achieve this correctly to work for both iOS 7 & 8 ????
Sorry for my poor english. Thanks in advance.