iPhone:以编程方式打开网址 [英] iPhone: Open a url Programmatically

查看:103
本文介绍了iPhone:以编程方式打开网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone新手。
我想在我的应用程序中打开一个URL。
我该怎么做这个任务?请建议我并提供一些有用的链接。

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.

推荐答案

更新(2016):最好的方法现在这样做是为了实例化并呈现一个SFSafariViewController。这为用户提供了Safari的安全性和速度,并且可以访问他们可能已经设置的任何Cookie或Safari功能,而无需离开您的应用。

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.

如果您想要在Safari中打开URL(并退出应用程序),您可以使用 uURpplication的openURL方法

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

如果您希望在应用内部处理它,请使用WKWebView。

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

这篇关于iPhone:以编程方式打开网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆