I am writing a reusable UIWebView
controller and want to descend from that while using the delegate shouldStartLoadWith function and override it as well but I'm not sure how to do it.
In my reusable UiWebView
controller I have this.
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
let docURLStr = request.mainDocumentURL!.absoluteString
if docURLStr.contains("login") {
loadLoginView()
return false
}
Then in my child class I want to do the following but I want to use both functions.How can I do that?
override func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
let docUrl = request.url!.absoluteString
if String(describing: docUrl).range(of: "some string in the url") != nil{
return true
} else {
return false
}
}