Pablo Pablo - 1 year ago 112
iOS Question

Objective C - Iphone. How can I show the numeric keyboard by default?

I'm trying the following with no luck. When the user click on a UiTextfield i need to change the keyboard view to the numeric view automatically, is this possible?
Thanks in advance.

Answer Source

The UITextInputTraits protocol (which UITextField conforms to) has a keyboardType property of type UIKeyboardType.

myTextField.keyboardType = UIKeyboardTypeNumberPad;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download