我正在尝试在Safari View Controller中打开各种WebView链接。
因此,在WebView(Swift)中,我需要能够在Safari View Controller中打开所有外部链接,但在WebView(自己)中打开的内部链接除外。
答案 0 :(得分:1)
//MARK: Button Click on open with SafariViewController
private var urlString:String = "https://google.com"
@IBAction func openWithSafariVC(sender: AnyObject)
{
let svc = SFSafariViewController(URL: NSURL(string: self.urlString)!)
svc.delegate = self
self.presentViewController(svc, animated: true, completion: nil)
}
//MARK: SafatriViewConroller Dismiss
func safariViewControllerDidFinish(controller: SFSafariViewController)
{
controller.dismissViewControllerAnimated(true, completion: nil)
}