ios - 启用地址栏的 Safari ViewController

标签 ios swift xcode button sfsafariviewcontroller

我正在使用 Safari ViewController 并且地址栏被禁用。如何启用它以便用户可以输入其他网址?

enter image description here

这是我正在使用的代码

class ViewController: UIViewController, SFSafariViewControllerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()           
    }

    @IBAction func showSafariVC(_ sender: AnyObject) {
        let svc = SFSafariViewController(url: NSURL(string: "http://www.google.com") as! URL)
        svc.delegate = self
        present(svc, animated: true, completion: nil)
    }
}

最佳答案

无法按照描述编辑 SFSafariViewController 的 URL here .

在苹果中developer site他们也提到了这一点:

A read-only address field with a security indicator and a Reader button

希望对您有所帮助!

关于ios - 启用地址栏的 Safari ViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41564845/

相关文章:

ios - 检查互联网连接 queryForTable Parse

ios - 任何人都可以在模拟器中运行的 xcode 构建/存档应用程序

ios - 嵌套的推送动画会导致损坏的导航栏多次警告

xcode - 如何在 Swift 中对抛出函数进行单元测试?

ios - 'NSInvalidUnarchiveOperationException',原因 : 'Could not instantiate class named MKMapView'

android - 如何在应用程序中构建小程序(又名tinyapp)框架?

ios - 实时检查网络可达性

ios - 快速放大位置

ios - 在 UIPageViewControllers 中预加载所有 UIViewControllers (Swift)

swift - 当我更改字距调整时,UITextView 样式会重置