I would like to open all external links which are in my application
(UIWebView
) not inside the app, but in Safari. How can I do that?
I have implement UiWebViewDelegate.
Working solution for my question bellow:
func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
if navigationType == UIWebViewNavigationType.LinkClicked{
UIApplication.sharedApplication().openURL(request.URL!)
return false
}
return true
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…