Contents

insertTextPlaceholder(with:)

Inserts a placeholder object to reserve visual space during text input.

Declaration

optional func insertTextPlaceholder(with size: CGSize) -> UITextPlaceholder

Parameters

  • size:

    The size of the space to reserve.

Return Value

The placeholder object that was inserted into the text input.

Discussion

If the size.height is less than or equal to zero, then the placeholder displays inline using the current line’s height.

If the size.height is greater than zero, then the text input treats the placeholder as a paragraph of height size.height.

See Also

Managing placeholders