从rootController swift呈现SFSafariViewController

时间:2016-08-26 11:43:32

标签: ios swift xcode ios9 sfsafariviewcontroller

我有UINavigationController,firstViewController(用于navigationController的rootController),secondViewController和SFSafariViewController。

如果我从firstViewController呈现SFSafariViewController,它会正确显示并成功加载页面。但是,如果我移动到secondViewController,并尝试呈现SafariViewController,我只看到白色窗口。

我试图从:

呈现SFSafariViewController
override func viewDidAppear(animated: Bool)

我尝试通过触摸按钮呈现SFSafariViewController并获得相同的结果。 show SFSafariViewController的代码:

let urlString:String = "https://google.com"
let url = NSURL(string:urlString)!
let svc = SFSafariViewController.init(URL: url)
self.navigationController?.presentViewController(svc, animated: true, completion: nil)

0 个答案:

没有答案