I\'d like to change the text from "Cancel" to "Done" of the Cancel button inside the UISearchBar
in iOS 8. I am using UISearchControll
Found it!. in iOS 8, the cancel button is under the key "cancelButton". I used UISearchBar delegate searchBarTextDidBeginEditing to make the change.
func searchBarTextDidBeginEditing(searchBar: UISearchBar) {
let uiButton = searchBar.valueForKey("cancelButton") as UIButton
uiButton.setTitle("Done", forState: UIControlState.Normal)
}