iPhone: Open a url Programmatically

前端 未结 4 746
情话喂你
情话喂你 2020-12-28 14:42

I am new to iPhone. I want to open an url in my application. How can I do this task? Please suggest me and provide some useful link.

4条回答
  •  遥遥无期
    2020-12-28 15:24

    Update (2016): The best way to do this nowadays is to instantiate and present an SFSafariViewController. This gives the user the security and speed of Safari, and access to any cookies or Safari features they may already have set without having to leave your app.

    If you want to open the URL in Safari (and exit your application) you can use the openURL method of UIApplication

    If you'd rather have it handled inside of your app, use WKWebView.

提交回复
热议问题