作品鏈接:
http://www.itdecent.cn/users/1e0f5e6f73f6/top_articles
1.代碼
- (IBAction)callPhone {
[self openURL:@"tel://10086"];
}
- (IBAction)sendMessage {
[self openURL:@"sms://10086"];
}
- (IBAction)jumpToSettings {
[self openURL:@"prefs:root=LOCATION_SERVICES"];
}
- (void)openURL:(NSString *)urlString
{
// 1.獲取打電話的URL
NSURL *url = [NSURL URLWithString:urlString];
// 2.判斷這個URL是否可以打開
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
}
2.系統(tǒng)界面的url圖片

Snip20160826_1.png