开发者

Placing a call with a text field and a button in iOS

开发者 https://www.devze.com 2023-02-06 08:01 出处:网络
Is it possible to make an app that will work like this: The app will have a text field and a button. In t开发者_开发知识库he textfield the user types in the phone number.

Is it possible to make an app that will work like this:

The app will have a text field and a button.

In t开发者_开发知识库he textfield the user types in the phone number.

When the user is done typing in the phone number the user hits the button which will open the Phone app and call that number.


Yes, this is possible. You'd set up the text field and button as per usual and have the action associated with the button extract the text from the UITextField using the "text" property. You can then use the "tel://" URL handler to make a call, although this will bring up a dialog asking the user to confirm:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://xxxx"]];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号