×

iOS Keyboard Types


Sometimes we want that user should compulsorily enter numbers only in Phone Number TextField then in that case you can specify keyboard type property (Basic scenario). Keyboard Type is used to take the input from the from keyboard in specified format.

Keyboard Types :-

1) UIKeyboardTypeNumberPad

UIKeyboardTypeNumberPad is used for PIN input and shows a numeric keyboard.

emailTextField.keyboardType =   UIKeyboardTypeNumberPad;


2) UIKeyboardTypePhonePad

UIKeyboardTypeNumberPad is Keyboard is optimized for entering phone numbers.

emailTextField.keyboardType =   UIKeyboardTypePhonePad;


3) UIKeyboardTypeEmailAddress

UIKeyboardTypeEmailAddress is Keyboard is optimized for entering email Address.

emailTextField.keyboardType =  UIKeyboardTypeEmailAddress;


5) UIKeyboardTypeDecimalPad

UIKeyboardTypeDecimalPad is used for entering decimal numbers.

emailTextField.keyboardType =  UIKeyboardTypeDecimalPad;


6) UIKeyboardTypeURL

Keyboard is optimized for URL entry. Mostly used Keyboard types are exaplined above.

7) UIKeyboardTypeTwitter

Keyboard is optimized for twitter with @ and # symbols.