WebViewDelegate

fileprivate class WebViewDelegate: NSObject, WKNavigationDelegate

The webView delegate object that performs execution uppon script loading

  • Undocumented

    See more

    Declaration

    Swift

    fileprivate class WebViewDelegate: NSObject, WKNavigationDelegate
  • The parent manager

    Declaration

    Swift

    private weak var manager: ReCaptchaWebViewManager?
  • The active requests’ urls

    Declaration

    Swift

    private var activeRequests = Set<String>(minimumCapacity: 0)
  • Declaration

    Swift

    init(manager: ReCaptchaWebViewManager)

    Parameters

    manager

    The parent manager

  • Decides whether to allow or cancel a navigation.

    Declaration

    Swift

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

    Parameters

    webView

    The web view invoking the delegate method.

    navigationAction

    Descriptive information about the action triggering the navigation request.

    decisionHandler

    The decision handler to call to allow or cancel the navigation. The argument is one of the constants of the enumerated type WKNavigationActionPolicy.

  • Decides whether to allow or cancel a navigation after its response is known.

    Declaration

    Swift

    func webView(
                _ webView: WKWebView,
                decidePolicyFor navigationResponse: WKNavigationResponse,
                decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void
            )

    Parameters

    webView

    The web view invoking the delegate method.

    navigationResponse

    Descriptive information about the navigation response.

    decisionHandler

    A block to be called when your app has decided whether to allow or cancel the navigation

  • Flag the requests as finished and call ReCaptcha execution if necessary

    Declaration

    Swift

    func execute()