searchBarSearchButtonClicked of UISearchBar does not cancel the input mode
This code works
public func searchBarSearchButtonClicked(searchBar: UISearchBar) {
print("search")
}
But if keyboard search button is pressed the UISearchBar is still active. To deactivate I have to press 'cancel' button. What have I missed?
Screenshot
以下解决了这个问题:
self.searchController?.active = false;