how to open the url in safari not in webview

后端 未结 10 1795
时光说笑
时光说笑 2020-12-28 16:18

I want to open an url in safari, outisde the app and not in webview.

I implemented the UIWebViewDelegate but I am still not able to open the url. Basically I am not

10条回答
  •  余生分开走
    2020-12-28 16:44

    For iOS 10+

    // Objective-C
    UIApplication *application = [UIApplication sharedApplication];
    [application openURL:URL options:@{} completionHandler:nil];
    
    // Swift
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
    

    For more info refer THIS.

提交回复
热议问题