Skip to main content
Logo Appt Light

Input keyboard type on iOS

Setting the keyboard type for input fields helps user entering data. For example, if users need to enter a number, it helps to show a numeric keyboard. If users need to enter an e-mail address, it helps if the at-key (@) is shown. You should always set an appropriate keyboard type.

On iOS, you can set a keyboard type by using the keyboardType property.

The following types are defined:

  • asciiCapable: a keyboard that displays standard ASCII characters

  • asciiCapableNumberPad: a number pad that outputs only ASCII digits

  • decimalPad: a keyboard with numbers and a decimal point

  • default: the default keyboard

  • emailAddress: a keyboard for entering email addresses

  • namePhonePad: a keypad for entering a person’s name or phone number

  • numberPad: a numeric keypad for PIN entry

  • numbersAndPunctuation: a keyboard for numbers and punctuation

  • phonePad: a keypad for entering telephone numbers

  • URL: a keyboard for URL entry

  • twitter: a keyboard for Twitter text entry, with easy access to the at '@' and hash '#' characters

  • webSearch: a keyboard for web search terms and URL entry

Example of using keyboardType:

usernameField.keyboardType = .numberPad


Let us know!