I put a searchBar in a tableHeaderView. Everything works fine on iphone 6, but on iphone 5s am I getting this weird result?
override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self tableView.sectionIndexColor = Constants.Colors.ThemeGreen tableView.sectionIndexBackgroundColor = UIColor.clearColor() tableView.sectionIndexTrackingBackgroundColor = UIColor.clearColor() tableView.contentInset = UIEdgeInsetsMake(0, 0, CGFloat(Constants.Dimensions.TabBarHeight), 0) resultSearchController = UISearchController(searchResultsController: nil) resultSearchController.searchResultsUpdater = self resultSearchController.dimsBackgroundDuringPresentation = false resultSearchController.definesPresentationContext = true tableView.tableHeaderView = resultSearchController.searchBar resultSearchController.searchBar.sizeToFit()
- NOTE. I am using NSFetchedResultController to retrieve data.

ios iphone uitableview autolayout uisearchbar
Mikael
source share