作品链接:
http://www.jianshu.com/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.系统界面的url图片