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];