mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Adds property for long press touch cancellation
This commit is contained in:
parent
6ae17e55bc
commit
a92dd3189b
@ -187,6 +187,12 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
||||
*/
|
||||
@property (nonatomic, weak) id<ASTextNodeDelegate> delegate;
|
||||
|
||||
/**
|
||||
@abstract If YES and a long press is recognized, touches are cancelled. Default is NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL longPressCancelsTouches;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
|
||||
@ -240,7 +240,7 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
||||
// If we are view-backed, support gesture interaction.
|
||||
if (!self.isLayerBacked) {
|
||||
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_handleLongPress:)];
|
||||
_longPressGestureRecognizer.cancelsTouchesInView = NO;
|
||||
_longPressGestureRecognizer.cancelsTouchesInView = self.longPressCancelsTouches;
|
||||
_longPressGestureRecognizer.delegate = self;
|
||||
[self.view addGestureRecognizer:_longPressGestureRecognizer];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user