The UITextField follows the UITextInputTraits protocol, which means that it has a keyboardType property that you can set.
myField.keyboardType = UIKeyboardTypeNumberPad;
You can also install it through the interface builder. From the text input signs, install the keyboard on the numeric keypad and thatβs it.
taskinoor Sep 26 '10 at 6:19 2010-09-26 06:19
source share