Instance Property

text

The text displayed by the text field.

Declaration

@property(nonatomic, copy) NSString *text;

Discussion

This string is @"" by default.

Assigning a new value to this property also replaces the value of the attributedText property with the same text, albeit without any inherent style attributes. Instead the text view styles the new string using the font, textColor, and other style-related properties of the class.

See Also

Accessing the Text Attributes

attributedText

The styled text displayed by the text field.

placeholder

The string that is displayed when there is no other text in the text field.

attributedPlaceholder

The styled string that is displayed when there is no other text in the text field.

defaultTextAttributes

The default attributes to apply to the text.

font

The font of the text.

textColor

The color of the text.

textAlignment

The technique to use for aligning the text.

typingAttributes

The attributes to apply to new text being entered by the user.

UITextBorderStyle

The type of border drawn around the text field.