【发布时间】:2018-08-10 10:28:12
【问题描述】:
class CustomScreen: UIView, SFSafariViewControllerDelegate {
@IBAction func webPageBtnAction(_ sender: Any) {
if #available(iOS 9.0, *) {
let svc = SFSafariViewController(url: NSURL(string: "https://stackoverflow.com/")! as URL)
svc.delegate = self
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController = svc
} else {
// Fallback on earlier versions
}
}
@available(iOS 9.0, *)
func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
controller.dismiss(animated: false, completion: nil)
}
}
由于某种原因,我无法关闭 SFSafariViewController。有什么想法吗?
【问题讨论】:
标签: swift uiwebview wkwebview uiwebviewdelegate sfsafariviewcontroller