Within my swift app, I am trying to hide the inputAccessoryView that shows when a user taps a textfield inside of a webview.
Here is the code attempting to do that:
func keyboardWillShow(notification: NSNotification) {
if let keyboardSize = (notification.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.CGRectValue() {
var keyboardView = UIApplication.sharedApplication().windows.last!.subviews.first!
keyboardView.inputAccessoryView = nil
}
}
But I am getting this error:
Cannot assign to property: ‘inputAccessoryView’ is a get-only property
Is there a better way to do this? Any ideas on how to get this to work?