samedi 25 avril 2015

headerview from previous view takes up space in UISearchController search results


I have a simple tableView, DailyAttendanceController, with a searchbar. Searchbar was added in its viewDidLoad. View TableView here.

var searchController:UISearchController!
// separate class to handle search results
let resultsController = SearchResultsController()

override func viewDidLoad() {
   super.viewDidLoad()

   searchController = UISearchController(searchResultsController: resultsController)

   let searchBar = searchController.searchBar
   searchBar.placeholder = "Search for a student"
   searchBar.sizeToFit()
   tableView.tableHeaderView = searchBar

   searchController.searchResultsUpdater = resultsController
}

I then created another class, SearchResultsController, to handle the search. Searching works fine, but space is allocated for DailyAttendanceController's header. View SearchResultsController here

How do I remove this?


Aucun commentaire:

Enregistrer un commentaire