Reputation: 446
I have a simple iOS app with two controllers. One of them holds a webview displaying a website. The website has its own keyboard which appears when editing html input fields. However, when trying to use one of these inputs iOS displays its own built in keyboard.
How to disable keyboard in iOS/swift from popping up in a single controller or within a web view?
Upvotes: 1
Views: 1078
Reputation: 100503
You can try
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillShow), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
///
@objc func keyboardWillShow(notification: NSNotification) {
self.view.endEditing(true)
}
Upvotes: 4