@Vignesh itβs good that the problem is solved, but UISearchDisplayControllerdoes it for us. It is true that this is a problem with the calculation of the keyboard, so I just had to bring back contentInsetand scrollIndicatorInsetsto UIEdgeInsetsZerowhere is my keyboard.
func searchDisplayController(controller: UISearchDisplayController, didHideSearchResultsTableView tableView: UITableView) {
NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardDidHideNotification, object: nil)
}
func searchDisplayController(controller: UISearchDisplayController, willShowSearchResultsTableView tableView: UITableView) {
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillHide", name: UIKeyboardDidHideNotification, object: nil)
}
func keyboardWillHide() {
let tableView = self.searchController.searchResultsTableView
tableView.contentInset = UIEdgeInsetsZero
tableView.scrollIndicatorInsets = UIEdgeInsetsZero
}
This is just another workaround, but it still works on iOS7 +
source
share