| Conforms to | |
| Framework | /System/Library/Frameworks/UIKit.framework |
| Availability | Available in iPhone OS 2.0 and later. |
| Declared in | UITextInputTraits.h |
The UITextInputTraits protocol defines features that are associated with keyboard input. All objects that support keyboard input must adopt this protocol in order to interact properly with the text input management system. The UITextField and UITextView classes already support this protocol.
autocapitalizationType required property
autocorrectionType required property
enablesReturnKeyAutomatically required property
keyboardAppearance required property
keyboardType required property
returnKeyType required property
secureTextEntry required property
For more about Objective-C properties, see “Properties” in The Objective-C Programming Language.
The auto-capitalization style for the text object. (required)
@property(nonatomic) UITextAutocapitalizationType autocapitalizationType
This property determines at what times the Shift key is automatically pressed, thereby making the typed character a capital letter. The default value for this property is UITextAutocapitalizationTypeNone.
Some keyboard types do not support auto-capitalization. Specifically, this option is ignored if the value in the keyboardType property is set to UIKeyboardTypeNumberPad, UIKeyboardTypePhonePad, or UIKeyboardTypeNamePhonePad.
UITextInputTraits.hThe auto-correction style for the text object. (required)
@property(nonatomic) UITextAutocorrectionType autocorrectionType
This property determines whether auto-correction is enabled or disabled during typing. With auto-correction enabled, the text object tracks unknown words and suggests a more suitable replacement candidate to the user, replacing the typed text automatically unless the user explicitly overrides the action.
The default value for this property is UITextAutocorrectionTypeDefault, which for most input methods results in auto-correction being enabled.
UITextInputTraits.hA Boolean value indicating whether the return key is automatically enabled when text is entered by the user. (required)
@property(nonatomic) BOOL enablesReturnKeyAutomatically
The default value for this property is NO. If you set it to YES, the keyboard disables the return key when the text entry area contains no text. As soon as the user enters any text, the return key is automatically enabled.
UITextInputTraits.hThe appearance style of the keyboard that is associated with the text object (required)
@property(nonatomic) UIKeyboardAppearance keyboardAppearance
This property lets you distinguish between the default text entry inside your application and text entry inside an alert panel. The default value for this property is UIKeyboardAppearanceDefault.
UITextInputTraits.hThe keyboard style associated with the text object. (required)
@property(nonatomic) UIKeyboardType keyboardType
Text objects can be targeted for specific types of input, such as plain text, email, numeric entry, and so on. The keyboard style identifies what keys are available on the keyboard and which ones appear by default. The default value for this property is UIKeyboardTypeDefault.
UITextInputTraits.hThe contents of the “return” key. (required)
@property(nonatomic) UIReturnKeyType returnKeyType
Setting this property to a different key type changes the title of the key and typically results in the keyboard being dismissed when it is pressed. The default value for this property is UIReturnKeyDefault.
UITextInputTraits.hIdentifies whether the text object should hide the text being entered. (required)
@property(nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry
This property is set to NO by default. Setting this property to YES creates a password-style text object, which hides the text being entered.
UITextInputTraits.hThe auto-capitalization behavior of a text-based view.
typedef enum {
UITextAutocapitalizationTypeNone,
UITextAutocapitalizationTypeWords,
UITextAutocapitalizationTypeSentences,
UITextAutocapitalizationTypeAllCharacters,
} UITextAutocapitalizationType;
UITextAutocapitalizationTypeNoneDo not capitalize any text automatically.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UITextAutocapitalizationTypeWordsCapitalize the first letter of each word automatically.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UITextAutocapitalizationTypeSentencesCapitalize the first letter of each sentence automatically.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UITextAutocapitalizationTypeAllCharactersCapitalize all characters automatically.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
If the script system does not support capitalization, the keyboard input method ignores these constants.
The auto-correction behavior of a text-based view.
typedef enum {
UITextAutocorrectionTypeDefault,
UITextAutocorrectionTypeNo,
UITextAutocorrectionTypeYes,
} UITextAutocorrectionType;
UITextAutocorrectionTypeDefaultChoose an appropriate auto-correction behavior for the current script system.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UITextAutocorrectionTypeNoDisable auto-correction behavior.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UITextAutocorrectionTypeYesEnable auto-correction behavior.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
If the script system does not support inline auto-correction, the keyboard input method ignores these constants.
The type of keyboard to display for a given text-based view.
typedef enum {
UIKeyboardTypeDefault,
UIKeyboardTypeASCIICapable,
UIKeyboardTypeNumbersAndPunctuation,
UIKeyboardTypeURL,
UIKeyboardTypeNumberPad,
UIKeyboardTypePhonePad,
UIKeyboardTypeNamePhonePad,
UIKeyboardTypeEmailAddress,
UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable
} UIKeyboardType;
UIKeyboardTypeDefaultUse the default keyboard for the current input method.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeASCIICapableUse a keyboard that displays standard ASCII characters.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeNumbersAndPunctuationUse the numbers and punctuation keyboard.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeURLUse a keyboard optimized for URL entry. This type features “.”, “/”, and “.com” prominently.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeNumberPadUse a numeric keypad designed for PIN entry. This type features the numbers 0 through 9 prominently. This keyboard type does not support auto-capitalization.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypePhonePadUse a keypad designed for entering telephone numbers. This type features the numbers 0 through 9 and the “*” and “#” characters prominently. This keyboard type does not support auto-capitalization.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeNamePhonePadUse a keypad designed for entering a person’s name or phone number. This keyboard type does not support auto-capitalization.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeEmailAddressUse a keyboard optimized for specifying email addresses. This type features the “@”, “.” and space characters prominently.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardTypeAlphabetDeprecated.
Use UIKeyboardTypeASCIICapable instead.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
The appearance of the keyboard used by a text-based view.
typedef enum {
UIKeyboardAppearanceDefault,
UIKeyboardAppearanceAlert,
} UIKeyboardAppearance;
UIKeyboardAppearanceDefaultUse the default keyboard appearance for the current input method.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIKeyboardAppearanceAlertUse a keyboard that is suitable for an alert panel.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
The text string displayed in the “return” key of a keyboard.
typedef enum {
UIReturnKeyDefault,
UIReturnKeyGo,
UIReturnKeyGoogle,
UIReturnKeyJoin,
UIReturnKeyNext,
UIReturnKeyRoute,
UIReturnKeySearch,
UIReturnKeySend,
UIReturnKeyYahoo,
UIReturnKeyDone,
UIReturnKeyEmergencyCall,
} UIReturnKeyType;
UIReturnKeyDefaultSet the text of the return key to “return”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyGoSet the text of the return key to “Go”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyGoogleSet the text of the return key to “Google”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyJoinSet the text of the return key to “Join”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyNextSet the text of the return key to “Next”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyRouteSet the text of the return key to “Route”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeySearchSet the text of the return key to “Search”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeySendSet the text of the return key to “Send”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyYahooSet the text of the return key to “Yahoo”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyDoneSet the text of the return key to “Done”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
UIReturnKeyEmergencyCallSet the text of the return key to “Emergency Call”.
Available in iPhone OS 2.0 and later.
Declared in UITextInputTraits.h.
Last updated: 2009-08-04