In viewWillAppear, I have added UISearchBar as my headerview of UITableView. When view loads, I hides UISearchbar under <
This worked for me:
// contentOffset will not change before the main runloop ends without queueing it, for iPad that is
dispatch_async(dispatch_get_main_queue(), ^{
// The search bar is hidden when the view becomes visible the first time
self.tableView.contentOffset = CGPointMake(0, CGRectGetHeight(self.searchBar.bounds));
});
Put it in your -viewDidLoad or -viewWillAppear