I have UIViewControllers UITableViewand a UISearchBarinside. As soon as the search panel becomes the first responder, there is a small gap between the search panel and the table view.


There is no space if it UISearchBaris a view subzone UIViewControllerinstead of being a subset UITableView.


Obviously, one problem with this approach is that the search bar adheres to the top and does not scroll along with other cells, which is undesirable.
Any ideas?
Edit:
The first two images correspond UISearchBarto being the child of the UITableViewbreak.
UISearchBar, UIViewController, .