Ho inserito la searchBar nella tabellaHeaderView. Tutto funziona bene su iphone 6 ma su iphone 5s ottengo questo risultato strano?searchBar sovrapposto alla vista dell'intestazione della sezione
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()
//Fetch data for the first time
do{
try fetchedResultsController.performFetch()
listHeaderView?.count = "\(fetchedResultsController.fetchedObjects!.count)"
}catch{
print("Error - Couldn't fetch list")
}
- NOTA: sto usando un NSFetchedResultController per recuperare i dati
Sto ancora affrontando questo problema –