views:

125

answers:

2

Hello, 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.

+5  A: 

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

myTextField.keyboardType = UIKeyboardTypeNumberPad;
Jacob Relkin
thank you very much!
Pablo
+2  A: 

UITextField conforms to UITextInputTraits protocol which means it has keyboardType property which you can set.

myField.keyboardType = UIKeyboardTypeNumberPad;

You can also set it via interface builder. From the text input traits set the keyboard to number pad and that's all.

taskinoor