NSString*phoneNUmber =@"18743047890";
UIAlertController *alertController = [UIAlertControlleralertControllerWithTitle:@"提示"
message:[NSStringstringWithFormat:@"确定拨打: %@ ?", phoneNUmber]
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction*okAlertAction = [UIAlertActionactionWithTitle:@"确定"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction*_Nonnullaction) {
[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:[NSStringstringWithFormat:@"tel://%@", phoneNUmber]]];
}];
UIAlertAction*cancleAlertAction = [UIAlertActionactionWithTitle:@"取消"
style:UIAlertActionStyleDefault
handler:nil];
[alertControlleraddAction:okAlertAction];
[alertControlleraddAction:cancleAlertAction];
[selfpresentViewController:alertControlleranimated:YEScompletion:nil];