Making a Button Call a Phone Number in iOS [duplicate] Making a Button Call a Phone Number in iOS [duplicate] ios ios

Making a Button Call a Phone Number in iOS [duplicate]


Try this out in your button action

-(IBAction)callPhone:(id)sender {    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://1115550123"]];}

Then in Interface Builder you should connect the TouchUpInside event to the previously declared action (callPhone:) and you are done.


You can also go back to your original app when finish the call just by using this one instead:

-(IBAction)callPhone:(id)sender {    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://2135554321"]];}

Enjoy!