RSDWebViewController
open class RSDWebViewController: UIViewController, UIWebViewDelegate
RSDWebViewController
is a simple view controller for showing a webview. The base-class implementation
supports loading a web view from a URL, HTML string, or RSDResourceTransformer
. It is assumed that
the property will be set for one of these values.
-
The URL to load into the webview on
viewWillAppear()
.Declaration
Swift
open var url: URL?
-
The HTML string to load into the webview on
viewWillAppear()
.Declaration
Swift
open var html: String?
-
The resource to load into the webview on
viewWillAppear()
.Declaration
Swift
open var resourceTransformer: RSDResourceTransformer?
-
Convenience method for instantiating a web view controller that is the root view controller for a navigation controller.
Declaration
Swift
open class func instantiateController() -> (RSDWebViewController, UINavigationController)
-
Override
viewDidLoad()
to instantiate a webview if there wasn’t one created using a storyboard or nib.Declaration
Swift
open override func viewDidLoad()
-
Override
viewWillAppear()
to load the webview on first appearance.Declaration
Swift
open override func viewWillAppear(_ animated: Bool)
-
Failed to load the webview. Default implementation will print the error to the console but is otherwise silent.
Declaration
Swift
open func loadFailed(with error: Error? = nil)
-
Dismiss the view controller that was presented modally.
Declaration
Swift
@objc open func close()
-
If the webview request is a clicked link then open using the
UIApplication.open()
method.Declaration
Swift
open func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool