Friday, December 2, 2022
HomeIOS Developmentios - WKWebView Not Catch ButtonAction in navigationAction Delegate

ios – WKWebView Not Catch ButtonAction in navigationAction Delegate


Appears… right here we confronted a difficulty.., When a consumer clicks Button on WkWebview which isn’t Caught by…

`func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
decisionHandler(.permit)

    // -1 "different" seen when assigning the url programatically
    // 0 "linkActivated" a hyperlink with an href attribute was tapped
    // 3 "reload" web page was refreshed
    
    guard let urlAsString = navigationAction.request.url?.absoluteString else {
        return
    }
   
        if navigationAction.navigationType.rawValue == 0 {
           //***Obtain Logic right here... 
        }
}` 

But it surely labored tremendous beforehand.

If I attempt to catch the button by its ClassName, However evaluateJavaScript returns a zero worth.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments