PiterPan PiterPan - 1 year ago 128
iOS Question

How to open external link from UIWebView not in my App, but in Safari? SWIFT

I would like to open all external links which are in my application

) not inside the app, but in Safari. How can I do that?
I have implement UiWebViewDelegate.

Answer Source

@Leo Dabus thanks a lot for this hint, but I guess I have a better solution:

func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
    if navigationType == UIWebViewNavigationType.LinkClicked{
        return false
    return true

this one works perfect.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download