iOS Developer Library — Pre-Release

Developer

UIKit User Interface Catalog

PDF

Text View

Text View Attributes Inspector Reference

image: ../Art/uitextview_attributes_inspector.pdf

Text

image: ../Art/uitextview_attributes_inspector_group-text.pdf

Text

Text Type

The type of the text view text.

Selection

Plain

Attributed

Text Type: Plain

image: ../Art/uitextview_attributes_inspector_group-text.pdf

Use this group to configure the text view plain text.

Text

The text view plain text.

Access: text

Color

The color of the text view plain text.

Access: textColor

Font

The font of the text view plain text.

Access: font

Alignment

The alignment of the text view plain text.

Text Type: Attributed

image: ../Art/uitextview_attributes_inspector_subgroup-text-attributed.pdf

Use this group set the characteristics of the selected text in Attributed Text.

To set alignment and other layout characteristics of part of the attributed text in code, you need to create an attributed string with the desired characteristics and assign it to attributedText.

Attributed Text Layout

The alignment and other layout characteristics of the selected attributed text.

Selection

image: ../Art/xcode_icon-text_align_left.pdf Left

image: ../Art/xcode_icon-text_align_center.pdf Center

image: ../Art/xcode_icon-text_align_right.pdf Right

image: ../Art/xcode_icon-text_align_justified.pdf Justified

image: ../Art/xcode_icon-text_align_natural.pdf Natural

image: ../Art/xcode_icon-text_attributes_color.pdf Text Color

image: ../Art/xcode_icon-text_attributes_background_color.pdf Background Color

image: ../Art/xcode_icon-text_attributes_more.pdf More

Font

The font of the selected attributed text.

Attributed Text

The the text view attributed text.

Access: attributedText

Allows Editing Attributes

Whether the user can change characteristics of the attributed text.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

allowsEditingTextAttributes

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

allowsEditingTextAttributes

YES

Behavior

image: ../Art/uitextview_attributes_inspector_group-behavior.png

Editable

Whether the user can edit text view text.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

editable

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

editable

YES

Data Detection

image: ../Art/uitextview_attributes_inspector_group-datadetection.pdf

Detection

Links

Whether the text view detects hyperlinks in the text.

Access: dataDetectorTypes

Selection

Code

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

text_view.dataDetectorTypes &= ~UIDataDetectorTypeLink

image: ../Art/user_interface_checkbox-selected.pdf Selected

text_view.dataDetectorTypes |= UIDataDetectorTypeLink

Addresses

Whether the text view detects addresses in the text.

Access: dataDetectorTypes

Selection

Code

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

text_view.dataDetectorTypes &= ~UIDataDetectorTypeAddress

image: ../Art/user_interface_checkbox-selected.pdf Selected

text_view.dataDetectorTypes |= UIDataDetectorTypeAddresses

Phone Numbers

Whether the view detects phone numbers in the text.

Access: dataDetectorTypes

Selection

Code

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

text_view.dataDetectorTypes &= ~UIDataDetectorTypePhoneNumber

image: ../Art/user_interface_checkbox-selected.pdf Selected

text_view.dataDetectorTypes |= UIDataDetectorTypePhoneNumber

Events

Whether the text view detects calendar events in the text.

Access: dataDetectorTypes

Selection

Code

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

text_view.dataDetectorTypes &= ~UIDataDetectorTypeCalendarEvent

image: ../Art/user_interface_checkbox-selected.pdf Selected

text_view.dataDetectorTypes |= UIDataDetectorTypeCalendarEvent

Text Input and Keyboard

image: ../Art/uitextview_attributes_inspector_group-textinput_keyboard.pdf

Capitalization

Whether and when the keyboard activates the Shift key while the user types text.

Correction

Whether to auto-correct text the text user types.

Keyboard

The keyboard that appears on text input.

Appearance

The keyboard to use for text input.

Return Key

The type of the keyboard Return key.

The type of the Return key specifies the Return key title.

Auto-enable Return Key

The Auto-enable Return Key checkbox has no effect on text views.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

enablesReturnKeyAutomatically

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

enablesReturnKeyAutomatically

YES

Secure

The Secure checkbox has no effect on text views.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

secureTextEntry

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

secureTextEntry

YES