Add canCancelAllTouchesInViews

This commit is contained in:
Peter 2019-08-02 20:05:24 +03:00
parent e857463a93
commit 44e9a12b81
2 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property ASScrollDirection scrollableDirections;
@property BOOL canCancelAllTouchesInViews;
@end
NS_ASSUME_NONNULL_END

View File

@ -33,6 +33,13 @@
return (ASScrollNode *)ASViewToDisplayNode(self);
}
- (BOOL)touchesShouldCancelInContentView:(UIView *)view {
if ([[self scrollNode] canCancelAllTouchesInViews]) {
return true;
}
return [super touchesShouldCancelInContentView:view];
}
#pragma mark - _ASDisplayView behavior substitutions
// Need these to drive interfaceState so we know when we are visible, if not nested in another range-managing element.
// Because our superclass is a true UIKit class, we cannot also subclass _ASDisplayView.