WebViewControllerMobile
public final class WebViewControllerMobile : UIViewController
extension WebViewControllerMobile: WKNavigationDelegate
A view controller with a web view and a cancel button in the navigation bar. It forwards its navigation actions and cancel button taps to blocks. The controller does not allow the user to type an address. An initial address is instead provided to instances of this class which is loaded when an instance is shown.
-
Initializes a new view controller with a web view.
Declaration
Swift
public init(address: URL, redirectHandler: @escaping (URL) -> Bool, cancelHandler: @escaping () -> Void)
Parameters
address
The address of the page to open when the view controller is shown.
redirectHandler
A block invoked when a navigation action is about to take place. Called with the destination address. The return value determines whether the controller should allow the redirect or not.
cancelHandler
A block invoked when the user taps on the cancel button.
-
Undocumented
Declaration
Swift
public override func viewDidLoad()
-
Undocumented
Declaration
Swift
public override func viewDidLayoutSubviews()
-
Undocumented
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
-
Undocumented
Declaration
Swift
public override func viewWillAppear(_ animated: Bool)
-
Undocumented
Declaration
Swift
public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void)
-
Undocumented
Declaration
Swift
public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!)
-
Undocumented
Declaration
Swift
public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error)