Skip to content

UITextView: textContainer property ​

The textContainer property is the area where text is laid out, an NSTextContainer.

Value ​

An NSTextContainer.

  • Read-only; assigning to it throws TypeError.
  • Every read returns the same object. Changing its properties changes the layout in the text view.

Examples ​

js
const input = new UITextView();
const container = input.textContainer;
console.log(container === input.textContainer, container.lineFragmentPadding);

Result: logs true 5.

Corresponding iOS API ​

UITextView.textContainer.

See also ​