Using a UISearchBar with showCancelButton=YES on iOS 5. Would like the cancel button to stay enabled when the keyboard drops down. Using the following code seems not to work:<
Swift 5:, Swift 4:
if let btnCancel = searchBar.value(forKey: "cancelButton") as? UIButton { btnCancel.isEnabled = true }