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

效果


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:[email protected]","http://www.baidu.com","itms-apps://","wechat://","App-Prefs:root=MUSIC","App-Prefs:root=WIFI","App-Prefs:root=STORE"]

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

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

下载链接见:下载地址

你可能感兴趣的:(菜鸟教程——app中常见openURL跳转)