註意 : 以下需要蘋果手機測試(真機測試)
一.撥打電話的兩種方式
//撥打電話方式1 (彈出提示是否呼叫,推薦這種)
UIWebView*callWebview =[[UIWebView alloc] init];
NSURL *telURL =[NSURL URLWithString:@tel:10086];
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];
//記得添加到view上
[self.view addSubview:callWebview];
//撥打電話方式2(直接撥打)
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@tel://10086]];
二.發郵件
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@mailto://88888888@qq.com]];
三.發短信
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@sms://13788888888]];
四.調用自帶的瀏覽器 safari
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@https://www.baidu.com]];