您的位置:首页 > 移动开发 > IOS开发

iOS调用打电话功能

2016-04-25 18:45 302 查看
UIAlertController
*alert = [UIAlertController
alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];

[alert
addAction:[UIAlertAction
actionWithTitle:@"025-58185888"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction
* _Nonnull action) {

//、调用
打电话phone

//iOS应用内拨打电话结束后返回应用

[[UIApplication
sharedApplication]
openURL:[NSURL
URLWithString:@"tel://025-58185888"]];

}]];

[alert
addAction:[UIAlertAction
actionWithTitle:@"取消"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction
* _Nonnull action) {

}]];

[self
presentViewController:alert
animated:YES
completion:nil];

//文字颜色

[alertAct1 setValue:[UIColor blackColor] forKey:@"_titleTextColor"];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: