@@ -133,6 +133,8 @@ @interface ASCollectionView () <ASRangeControllerDataSource, ASRangeControllerDe
133133
134134 struct {
135135 unsigned int asyncDelegateScrollViewDidScroll:1 ;
136+ unsigned int asyncDelegateScrollViewWillBeginDragging:1 ;
137+ unsigned int asyncDelegateScrollViewDidEndDragging:1 ;
136138 unsigned int asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset:1 ;
137139 unsigned int asyncDelegateCollectionViewWillDisplayNodeForItemAtIndexPath:1 ;
138140 unsigned int asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath:1 ;
@@ -396,6 +398,8 @@ - (void)setAsyncDelegate:(id<ASCollectionViewDelegate>)asyncDelegate
396398 _asyncDelegateFlags.asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath = [_asyncDelegate respondsToSelector: @selector (collectionView:didEndDisplayingNode:forItemAtIndexPath: )];
397399 _asyncDelegateFlags.asyncDelegateCollectionViewWillBeginBatchFetchWithContext = [_asyncDelegate respondsToSelector: @selector (collectionView:willBeginBatchFetchWithContext: )];
398400 _asyncDelegateFlags.asyncDelegateShouldBatchFetchForCollectionView = [_asyncDelegate respondsToSelector: @selector (shouldBatchFetchForCollectionView: )];
401+ _asyncDelegateFlags.asyncDelegateScrollViewWillBeginDragging = [_asyncDelegate respondsToSelector: @selector (scrollViewWillBeginDragging: )];
402+ _asyncDelegateFlags.asyncDelegateScrollViewDidEndDragging = [_asyncDelegate respondsToSelector: @selector (scrollViewDidEndDragging:willDecelerate: )];
399403 }
400404
401405 super.delegate = (id <UICollectionViewDelegate>)_proxyDelegate;
@@ -672,6 +676,29 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi
672676 }
673677}
674678
679+ - (void )scrollViewWillBeginDragging : (UIScrollView *)scrollView
680+ {
681+ for (_ASCollectionViewCell *collectionCell in _cellsForVisibilityUpdates) {
682+ [[collectionCell node ] cellNodeVisibilityEvent: ASCellNodeVisibilityEventWillBeginDragging
683+ inScrollView: scrollView
684+ withCellFrame: collectionCell.frame];
685+ }
686+ if (_asyncDelegateFlags.asyncDelegateScrollViewWillBeginDragging ) {
687+ [_asyncDelegate scrollViewWillBeginDragging: scrollView];
688+ }
689+ }
690+
691+ - (void )scrollViewDidEndDragging : (UIScrollView *)scrollView willDecelerate : (BOOL )decelerate
692+ {
693+ for (_ASCollectionViewCell *collectionCell in _cellsForVisibilityUpdates) {
694+ [[collectionCell node ] cellNodeVisibilityEvent: ASCellNodeVisibilityEventDidEndDragging
695+ inScrollView: scrollView
696+ withCellFrame: collectionCell.frame];
697+ }
698+ if (_asyncDelegateFlags.asyncDelegateScrollViewDidEndDragging ) {
699+ [_asyncDelegate scrollViewDidEndDragging: scrollView willDecelerate: decelerate];
700+ }
701+ }
675702
676703#pragma mark - Scroll Direction.
677704
0 commit comments