IOS provides 10 keyboard types, in development, we can choose different keyboard styles according to different needs, for example, when we only need to enter a mobile phone number, you can choose a pure numeric type of keyboard (numbersandpunctuation), when we need to enter the URL, You can select a URL-style keyboard (Uikeyboardtypeurl), where the default keyboard style (Uikeyboardtypedefault) is the (Uikeyboardtypenamephonepad) style.
We can set the keyboard style by keyboardtype the input box
UITextField.keyboardType = UIKeyboardTypeNamePhonePad;
1, Uikeyboardtypedefault,//Default type forThe current input method.2, uikeyboardtypeasciicapable,//displays a keyboard which can enter ASCII characters, Non-ascii Keyboa RDS remain active3, uikeyboardtypenumbersandpunctuation,//Numbers andAssorted punctuation.4, Uikeyboardtypeurl,//AtypeOptimized forURL entry (shows./. com prominently).5, Uikeyboardtypenumberpad,//A number pad (0-9). Suitable forPIN entry.6, Uikeyboardtypephonepad,//A phone pad (1-9, *,0, #, withLetters under the numbers).7, Uikeyboardtypenamephonepad,//AtypeOptimized forEntering a person' sNameorPhone number.8, uikeyboardtypeemailaddress,//AtypeOptimized forMultiple Email address entry (shows space @. prominently).9, Uikeyboardtypedecimalpad Ns_enum_available_ios (4_1),//A number pad withA decimal point.Ten, Uikeyboardtypetwitter Ns_enum_available_ios (5_0),//AtypeOptimized forTwitter text entry (easyAccess to@ #) One, Uikeyboardtypewebsearch Ns_enum_available_ios (7_0),//AdefaultKeyboardtype withurl-oriented addition (shows space. prominently).
The following image shows the difference
Uikeyboardtypedefault
Uikeyboardtypenumbersandpunctuation
Uikeyboardtypeurl
Uikeyboardtypenumberpad
Uikeyboardtypephonepad
Uikeyboardtypeemailaddress
Uikeyboardtypedecimalpad
Uikeyboardtypetwitter
Uikeyboardtypewebsearch
ios-keyboard pop-up type