mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 06:10:03 +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;
|
@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
|
@end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -240,7 +240,7 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
|||||||
// If we are view-backed, support gesture interaction.
|
// If we are view-backed, support gesture interaction.
|
||||||
if (!self.isLayerBacked) {
|
if (!self.isLayerBacked) {
|
||||||
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_handleLongPress:)];
|
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_handleLongPress:)];
|
||||||
_longPressGestureRecognizer.cancelsTouchesInView = NO;
|
_longPressGestureRecognizer.cancelsTouchesInView = self.longPressCancelsTouches;
|
||||||
_longPressGestureRecognizer.delegate = self;
|
_longPressGestureRecognizer.delegate = self;
|
||||||
[self.view addGestureRecognizer:_longPressGestureRecognizer];
|
[self.view addGestureRecognizer:_longPressGestureRecognizer];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user