In viewWillAppear, I have added UISearchBar as my headerview of UITableView. When view loads, I hides UISearchbar under <
viewWillAppear
UISearchBar
UITableView
UISearchbar
You need to hide the search bar by yourself when you scroll the table. So don't put it as a UITableView header. You could hide it by setting its height to zero. That way if your table view is set to auto resize, it will expand.