File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
LXReorderableCollectionViewFlowLayout Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 2323@optional
2424
2525- (void )collectionView : (UICollectionView *)collectionView itemAtIndexPath : (NSIndexPath *)fromIndexPath willMoveToIndexPath : (NSIndexPath *)toIndexPath ;
26+ - (void )collectionView : (UICollectionView *)collectionView itemAtIndexPath : (NSIndexPath *)fromIndexPath didMoveToIndexPath : (NSIndexPath *)toIndexPath ;
27+
2628- (BOOL )collectionView : (UICollectionView *)collectionView canMoveItemAtIndexPath : (NSIndexPath *)indexPath ;
2729- (BOOL )collectionView : (UICollectionView *)collectionView itemAtIndexPath : (NSIndexPath *)fromIndexPath canMoveToIndexPath : (NSIndexPath *)toIndexPath ;
2830
Original file line number Diff line number Diff line change @@ -165,7 +165,12 @@ - (void)invalidateLayoutIfNecessary {
165165 [strongSelf.collectionView deleteItemsAtIndexPaths: @[ previousIndexPath ]];
166166 [strongSelf.collectionView insertItemsAtIndexPaths: @[ newIndexPath ]];
167167 }
168- } completion: nil ];
168+ } completion: ^(BOOL finished) {
169+ __strong typeof (self) strongSelf = weakSelf;
170+ if ([strongSelf.dataSource respondsToSelector: @selector (collectionView:itemAtIndexPath:didMoveToIndexPath: )]) {
171+ [strongSelf.dataSource collectionView: strongSelf.collectionView itemAtIndexPath: previousIndexPath didMoveToIndexPath: newIndexPath];
172+ }
173+ }];
169174}
170175
171176- (void )invalidatesScrollTimer {
You can’t perform that action at this time.
0 commit comments