I'd like to change the text from "Cancel" to "Done" of the Cancel button inside the UISearchBar
in iOS 8. I am using UISearchController
. I've tried different approaches for iOS 6 and iOS 7 and they do not work. Has anybody done this?
Objective-C:
[searchBar setValue:@"customString" forKey:@"_cancelButtonText"];
Swift:
searchBar.setValue("customString", forKey:"_cancelButtonText")