diff --git a/Source/Details/_ASCollectionViewCell.mm b/Source/Details/_ASCollectionViewCell.mm index bd36d56bf..39afa167d 100644 --- a/Source/Details/_ASCollectionViewCell.mm +++ b/Source/Details/_ASCollectionViewCell.mm @@ -8,6 +8,7 @@ // #import +#import #import #import @@ -94,6 +95,29 @@ - (void)layoutSubviews self.node.frame = self.contentView.bounds; } +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event +{ + /** + * The documentation for hitTest:withEvent: on an UIView explicitly states the fact that: + * it ignores view objects that are hidden, that have disabled user interactions, or have an + * alpha level less than 0.01. + * To be able to determine if the collection view cell should skip going further down the tree + * based on the states above we use a valid point within the cells bounds and check the + * superclass hitTest:withEvent: implementation. If this returns a valid value we can go on with + * checking the node as it's expected to not be in one of these states. + */ + if (![super hitTest:self.bounds.origin withEvent:event]) { + return nil; + } + + return [self.node hitTest:point withEvent:event]; +} + +- (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event +{ + return [self.node pointInside:point withEvent:event]; +} + @end /**