Home > Back-end >  How to know when TextField in a WKWebView is Tapped
How to know when TextField in a WKWebView is Tapped

Time:11-20

In this Apple doc about Keyboards, the first sentence says:

When users touch a text field, a text view, or a field in a web view, the system displays a keyboard.

Are there any methods or KVO observers to know when a user starts/stops typing in a field in WKWebView?

For example, when interacting with a regular UITextField, if I want to know when a user starts and stops typing, these two methods are available, but WKWebView doesn't have anything like these

func textFieldDidBeginEditing(_ textField: UITextField) {
}

func textFieldDidEndEditing(_ textField: UITextField) {

}

I don't need the keyboardWillShow/Hide notifications. I need some delegate methods or a KVO for the textFields specific to WKWebView.

CodePudding user response:

Unfortunately WKWebView does't have delegate methods that gets called when web form inputs are triggered.

  • Related