-(void)phoneSheetAlet:(NSString *)title msg:(NSString *)msg phoneNumber:(NSString *)phoneNumber
{
UIAlertController *alertContrller= [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet] ;
alertContrller.view.tintColor = kColor(@"#FD5105");//改变alertview的文字颜色
UIAlertAction *actionConfirm =[UIAlertAction actionWithTitle:[NSString stringWithFormat:@"呼叫 %@",phoneNumber] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSMutableString * str = [[NSMutableString alloc] initWithFormat:@"tel:%@",phoneNumber];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}] ;
UIAlertAction *actionCancel =[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}] ;
[alertContrller addAction:actionConfirm] ;
[alertContrller addAction:actionCancel] ;
[self presentViewController:alertContrller animated:YES completion:nil] ;
}
暂无评论
要发表评论,您必须先 登录