开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜