Instance Method

insertText(_:)

Insert a character into the displayed text.

Required.

Declaration

func insertText(_ text: String)

Parameters

text

A string object representing the character typed on the system keyboard.

Discussion

Add the character text to your class’s backing store at the index corresponding to the cursor and redisplay the text.

See Also

Inserting and Deleting Text

func deleteBackward()

Delete a character from the displayed text.

Required.

var hasText: Bool

A Boolean value that indicates whether the text-entry objects has any text.

Required.