How to hide the done button and search bar in Safa

2019-03-27 21:12发布

I'm using SafariViewControllerto display a webpage, and rather than the default "done" button I push from my app's NavigationController to preserve my nav stack and back arrow. However, I need to hide the default Done button and search bar on the SafariViewController. Is that possible yet? See my code and screen shot below...

let svc = SFSafariViewController(URL: pinterestSafariURL)
            navigationController?.pushViewController(svc, animated: true)

enter image description here

note: linking to this question, but the answer is a hack whereas I was looking for a solution using SafariViewController API : SFSafariViewController: Hide navigation bar

1条回答
Animai°情兽
2楼-- · 2019-03-27 21:55

Per Apple's documentation on SFSafariViewController, there does not appear to be a publicly-accessible way to hide either the Done button or the URL bar. Apple suggests that you use WKWebView if you need a custom browser interface.

There's a AppCoda tutorial on WKWebView that shows you how to create a ViewController with an embedded WKWebView. Hope that helps!

查看更多
登录 后发表回答