Protocol

UITextInputTraits

A collection of methods that defines features associated with keyboard input to a text object.

Declaration

@protocol UITextInputTraits

Overview

For a custom text object to support keyboard input, it must adopt this protocol to interact properly with the text input management system. The UITextField and UITextView classes automatically support this protocol.

Topics

Configuring the Keyboard Appearance

keyboardType

The keyboard style associated with the text object.

UIKeyboardType

The type of keyboard to display for a given text-based view. Used with the keyboardType property.

keyboardAppearance

The appearance style of the keyboard that is associated with the text object

UIKeyboardAppearance

The appearance of the keyboard used by a text-based view. Used with the keyboardAppearance property.

returnKeyType

The visible title of the Return key.

UIReturnKeyType

The text string displayed in the Return key of a keyboard. Used with the returnKeyType property.

textContentType

The semantic meaning expected by a text input area.

UITextContentType

Constants that identify the semantic meaning expected for a text-entry area.

Managing the Keyboard Behavior

secureTextEntry

Identifies whether the text object should disable text copying and in some cases hide the text being entered.

enablesReturnKeyAutomatically

A Boolean value indicating whether the Return key is automatically enabled when the user is entering text.

Managing Spelling and Autocorrection

autocapitalizationType

The auto-capitalization style for the text object.

UITextAutocapitalizationType

The auto-capitalization behavior of a text-based view. Used with the autocapitalizationType property.

autocorrectionType

The autocorrection style for the text object.

UITextAutocorrectionType

The autocorrection behavior of a text-based view. Used with the autocorrectionType property.

spellCheckingType

The spell-checking style for the text object.

UITextSpellCheckingType

The spell-checking behavior of a text-based view. Used with the spellCheckingType property.

Configuring the Auto-Formatting Behaviors

smartQuotesType

The configuration state for smart quotes.

UITextSmartQuotesType

Constants indicating whether smart quotes are enabled or disabled.

smartDashesType

The configuration state for smart dashes.

UITextSmartDashesType

Constants for specifying the automatic conversion behavior between hyphens and en or em dashes.

smartInsertDeleteType

The configuration state for the smart insertion and deletion of space characters.

UITextSmartInsertDeleteType

Constants for specifying whether extra spaces are automatically inserted after a paste operation or deleted after a cut or delete operation.

Configuring Password AutoFill

Password AutoFill

Streamline your app’s login and onboarding procedures.

Relationships

Inherits From

Inherited By

Conforming Types

See Also

Configuration

UITextInputAssistantItem

An object that manages bar button items displayed in the shortcuts bar above the keyboard on iPad.