In my app i have a TableView which has a header that i want to hide initially until the user scrolls the tableview. My problem is when the view loads, for 1 second you can see the tableview moving up. I dont want to see this movement. How can i achieve this correctly?
This is my code:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self performSelector:@selector(hideSearchBar) withObject:nil afterDelay:0.0f];
}
- (void)hideSearchBar
{
self.tblView.contentOffset = CGPointMake(0, 40);
}