I wish to change the title of the cancel button in iOS. I have been using this previously:
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayCon
Chiming in with the code I used inside the UIKitUISearchResultsUpdating protocol method updateSearchResults(for searchController: UISearchController):
if let cancelButton : UIButton = searchController.searchBar.value(forKey: "_cancelButton") as? UIButton {
cancelButton.setTitle("Back", for: UIControlState.normal)
}
(iOS 10, Swift 3.0)