我想关闭SFSafariViewController而不需要用户点击左上角的完成按钮。
let svc = SFSafariViewController(URL: NSURL(string: "http://spotify.com")!)
self.presentViewController(svc, animated: true, completion: nil)发布于 2018-05-29 17:48:34
我在这里添加这个解决方案,因为我正在寻找相同的行为,但我没有找到任何好的答案。
像这样展示你的SFSafariViewController:
let URL = NSURL(string: "www.to-load.com")
let webVC = SFSafariViewController(url: URL! as URL)
present(webVC, animated: true)
webVC.loadViewIfNeeded()然后你可以像这样把它合上。
self.navigationController?.popViewController(animated: true)
self.dismiss(animated: true, completion: nil)是的,我检查过了,它起作用了。
https://stackoverflow.com/questions/39096902
复制相似问题