Fix GalleryPagerNode gesture conflict

This commit is contained in:
Ali 2020-02-21 18:29:42 +04:00
parent 155b61a678
commit 868dcdf05d
3 changed files with 11 additions and 5 deletions

View File

@ -983,4 +983,8 @@ typedef NS_ENUM(NSInteger, ASLayoutEngineType) {
@end
@interface UIView (ASDisplayNodeInternal)
@property (nullable, weak) ASDisplayNode *asyncdisplaykit_node;
@end
NS_ASSUME_NONNULL_END

View File

@ -316,10 +316,6 @@ __unused static NSString * _Nonnull NSStringFromASHierarchyStateChange(ASHierarc
- (NSArray *)accessibilityElements;
@end;
@interface UIView (ASDisplayNodeInternal)
@property (nullable, weak) ASDisplayNode *asyncdisplaykit_node;
@end
@interface CALayer (ASDisplayNodeInternal)
@property (nullable, weak) ASDisplayNode *asyncdisplaykit_node;
@end

View File

@ -145,7 +145,13 @@ public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGest
let recognizer = TapLongTapOrDoubleTapGestureRecognizer(target: self, action: #selector(self.tapLongTapOrDoubleTapGesture(_:)))
recognizer.delegate = self
self.tapRecognizer = recognizer
recognizer.tapActionAtPoint = { _ in
recognizer.tapActionAtPoint = { [weak self] point in
guard let strongSelf = self else {
return .fail
}
if let result = strongSelf.hitTest(point, with: nil), let node = result.asyncdisplaykit_node as? ASButtonNode {
return .fail
}
return .keepWithSingleTap
}
recognizer.highlight = { [weak self] point in