mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
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:
@@ -418,8 +418,8 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
||||
|
||||
// Check if delegate implements optional method, if not assume NO.
|
||||
// Should the text be highlightable/touchable?
|
||||
if (![_delegate respondsToSelector:@selector(textNode:shouldHighlightLinkAttribute:value:)] ||
|
||||
![_delegate textNode:self shouldHighlightLinkAttribute:name value:value]) {
|
||||
if (![_delegate respondsToSelector:@selector(textNode:shouldHighlightLinkAttribute:value:atPoint:)] ||
|
||||
![_delegate textNode:self shouldHighlightLinkAttribute:name value:value atPoint:point]) {
|
||||
value = nil;
|
||||
name = nil;
|
||||
}
|
||||
@@ -465,8 +465,11 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
||||
}
|
||||
|
||||
// Ask our delegate if a long-press on an attribute is relevant
|
||||
if ([self.delegate respondsToSelector:@selector(textNode:shouldLongPressLinkAttribute:value:)]) {
|
||||
return [self.delegate textNode:self shouldLongPressLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue];
|
||||
if ([self.delegate respondsToSelector:@selector(textNode:shouldLongPressLinkAttribute:value:atPoint:)]) {
|
||||
return [self.delegate textNode:self
|
||||
shouldLongPressLinkAttribute:_highlightedLinkAttributeName
|
||||
value:_highlightedLinkAttributeValue
|
||||
atPoint:[gestureRecognizer locationInView:self.view]];
|
||||
}
|
||||
|
||||
// Otherwise we are good to go.
|
||||
|
||||
Reference in New Issue
Block a user