How we can change the title of cancel button in search controller?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- Popover segue to static cell UITableView causes co
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
You also need to have the
searchBar setShowsCancelButton
before the procedure.Note also use UIButton to avoid problems with Apple!
Worth noting, that the preferred method for changing the Cancel button title is now via appearances (got the idea from an another question: https://stackoverflow.com/a/34522163/511878):
The solution provided above could change with new iOS releases. Here is a better approach:
The Swift equivalent of Burhanuddin Sunelwala answer did the trick for me!
Thanks to Burhanuddin Sunelwala for putting me in the right direction!