Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 启用地址栏的Safari ViewController_Ios_Swift_Xcode_Button_Sfsafariviewcontroller - Fatal编程技术网

Ios 启用地址栏的Safari ViewController

Ios 启用地址栏的Safari ViewController,ios,swift,xcode,button,sfsafariviewcontroller,Ios,Swift,Xcode,Button,Sfsafariviewcontroller,我正在使用Safari ViewController,地址栏已禁用。我如何使其启用,以便用户可以输入其他url 这是我正在使用的代码 class ViewController: UIViewController, SFSafariViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() } @IBAction func showSafar

我正在使用Safari ViewController,地址栏已禁用。我如何使其启用,以便用户可以输入其他url

这是我正在使用的代码

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

在苹果,他们也提到:

带有安全指示符和读卡器的只读地址字段 钮扣


希望这有帮助

我至少可以得到当前网页的URL吗?也许这可以帮助你。