mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
ASTextNode shouldn't create a long press gesture recognizer unless the delegate cares about the callback.
This commit is contained in:
@@ -211,8 +211,9 @@ static NSString *ASTextNodeTruncationTokenAttributeName = @"ASTextNodeTruncation
|
||||
{
|
||||
[super didLoad];
|
||||
|
||||
// If we are view-backed, support gesture interaction.
|
||||
if (!self.isLayerBacked) {
|
||||
// If we are view-backed and the delegate cares, support the long-press callback.
|
||||
SEL longPressCallback = @selector(textNode:longPressedLinkAttribute:value:atPoint:textRange:);
|
||||
if (!self.isLayerBacked && [self.delegate respondsToSelector:longPressCallback]) {
|
||||
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_handleLongPress:)];
|
||||
_longPressGestureRecognizer.cancelsTouchesInView = self.longPressCancelsTouches;
|
||||
_longPressGestureRecognizer.delegate = self;
|
||||
|
||||
Reference in New Issue
Block a user