I have a UITableView which has a UISearchBar subview. This is all on the view of a UIViewController along with a few other subviews (l
UITableView
UISearchBar
UIViewController
Update : automaticallyAdjustsScrollViewInsets has been deprecated in ios 11 and a new field contentInsetAdjustmentBehavior has been introduced.
automaticallyAdjustsScrollViewInsets
contentInsetAdjustmentBehavior
if #available(iOS 11.0, *) { tableview.contentInsetAdjustmentBehavior = .never } else { automaticallyAdjustsScrollViewInsets = false }