Add point parameter to ASTextNode delegate methods

Outfit ASTextNodeDelegate shouldHighlight and shouldLongPress methods
with a point parameter that describes the location of the relevant
touch.
This commit is contained in:
Ben Cunningham
2014-10-27 16:53:44 -07:00
parent bd30f975ab
commit 32d005dc0b
3 changed files with 12 additions and 7 deletions

View File

@@ -204,19 +204,21 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
@param textNode The text node containing the entity attribute.
@param attribute The attribute that was tapped. Will not be nil.
@param value The value of the tapped attribute.
@param point The point within textNode, in textNode's coordinate system, that was touched to trigger a highlight.
@discussion If not implemented, the default value is NO.
@return YES if the entity attribute should be a link, NO otherwise.
*/
- (BOOL)textNode:(ASTextNode *)textNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value;
- (BOOL)textNode:(ASTextNode *)textNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point;
/**
@abstract Indicates to the text node if an attribute is a valid long-press target
@param textNode The text node containing the entity attribute.
@param attribute The attribute that was tapped. Will not be nil.
@param value The value of the tapped attribute.
@param point The point within textNode, in textNode's coordinate system, that was long-pressed.
@discussion If not implemented, the default value is NO.
@return YES if the entity attribute should be treated as a long-press target, NO otherwise.
*/
- (BOOL)textNode:(ASTextNode *)textNode shouldLongPressLinkAttribute:(NSString *)attribute value:(id)value;
- (BOOL)textNode:(ASTextNode *)textNode shouldLongPressLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point;
@end