ASTextNodeDelegate Protocol Reference

Conforms to NSObject
Declared in ASTextNode.h

– textNode:tappedLinkAttribute:value:atPoint:textRange:

Indicates to the delegate that a link was tapped within a text node.

- (void)textNode:(ASTextNode *)textNode tappedLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point textRange:(NSRange)textRange

Parameters

textNode

The ASTextNode containing the link that was tapped.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was tapped.

textRange

The range of highlighted text.

Declared In

ASTextNode.h

– textNode:longPressedLinkAttribute:value:atPoint:textRange:

Indicates to the delegate that a link was tapped within a text node.

- (void)textNode:(ASTextNode *)textNode longPressedLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point textRange:(NSRange)textRange

Parameters

textNode

The ASTextNode containing the link that was tapped.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was tapped.

textRange

The range of highlighted text.

Discussion

In addition to implementing this method, the delegate must be set on the text node before it is loaded (the recognizer is created in -didLoad)

Declared In

ASTextNode.h

– textNode:shouldHighlightLinkAttribute:value:atPoint:

Indicates to the text node if an attribute should be considered a link.

- (BOOL)textNode:(ASTextNode *)textNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point

Parameters

textNode

The text node containing the entity attribute.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was touched to trigger a highlight.

Return Value

YES if the entity attribute should be a link, NO otherwise.

Discussion

If not implemented, the default value is YES.

Declared In

ASTextNode.h

– textNode:shouldLongPressLinkAttribute:value:atPoint:

Indicates to the text node if an attribute is a valid long-press target

- (BOOL)textNode:(ASTextNode *)textNode shouldLongPressLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point

Parameters

textNode

The text node containing the entity attribute.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was long-pressed.

Return Value

YES if the entity attribute should be treated as a long-press target, NO otherwise.

Discussion

If not implemented, the default value is NO.

Declared In

ASTextNode.h