菜鸟教程——app中常见openURL跳转

2017-08-18  本文已影响0人  iOS谢先森
效果

iOS8.0之前的跳转方式是

UIApplication.shared.openURL(NSURL(string: "App-Prefs:root=MUSIC") as! URL)

8.0之后

UIApplication.shared.open(NSURL(string: App-Prefs:root=MUSIC)! as URL, options: [:],

completionHandler: {

(success) in

})

下面列出一个数组

let arr = ["tel:10086","telprompt://10010","sms://10086","mailto:421482590@qq.com","http://www.baidu.com","itms-apps://","wechat://","App-Prefs:root=MUSIC","App-Prefs:root=WIFI","App-Prefs:root=STORE"]

分别是手机号,短信,邮件,网页,appStore,微信,系统设置等。

有些操作必须要在真机上测试。

下载链接见:下载地址

上一篇下一篇

猜你喜欢

热点阅读