ASEditableTextNode Class Reference

Inherits from ASDisplayNode : ASDealloc2MainObject
Declared in ASEditableTextNode.h

  textView

Access to underlying UITextView for more configuration options.

@property (nonatomic, readonly, strong) UITextView *textView

Discussion

Warning: This property should only be used on the main thread and should not be accessed before the editable text node’s view is created.

Declared In

ASEditableTextNode.h

– isDisplayingPlaceholder

Indicates if the receiver is displaying the placeholder text.

- (BOOL)isDisplayingPlaceholder

Return Value

YES if the placeholder is currently displayed; NO otherwise.

Discussion

To update the placeholder, see the attributedPlaceholderText property.

Declared In

ASEditableTextNode.h

  attributedPlaceholderText

The styled placeholder text displayed by the text node while no text is entered

@property (nonatomic, readwrite, strong) NSAttributedString *attributedPlaceholderText

Discussion

The placeholder is displayed when the user has not entered any text and the keyboard is not visible.

Declared In

ASEditableTextNode.h

  attributedText

The styled text displayed by the receiver.

@property (nonatomic, readwrite, copy) NSAttributedString *attributedText

Discussion

When the placeholder is displayed (as indicated by -isDisplayingPlaceholder), this value is nil. Otherwise, this value is the attributed text the user has entered. This value can be modified regardless of whether the receiver is the first responder (and thus, editing) or not. Changing this value from nil to non-nil will result in the placeholder being hidden, and the new value being displayed.

Declared In

ASEditableTextNode.h

– isFirstResponder

Indicates whether the receiver’s text view is the first responder, and thus has the keyboard visible and is prepared for editing by the user.

- (BOOL)isFirstResponder

Return Value

YES if the receiver’s text view is the first-responder; NO otherwise.

Declared In

ASEditableTextNode.h

– frameForTextRange:

Returns the frame of the given range of characters.

- (CGRect)frameForTextRange:(NSRange)textRange

Parameters

textRange

A range of characters.

Return Value

A CGRect that is the bounding box of the glyphs covered by the given range of characters, in the coordinate system of the receiver.

Discussion

This method raises an exception if textRange is not a valid range of characters within the receiver’s attributed text.

Declared In

ASEditableTextNode.h