LxGridViewFlowLayout.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // LxGridViewFlowLayout.h
  3. // LxGridView
  4. //
  5. #import <UIKit/UIKit.h>
  6. /*
  7. 此类来源于DeveloperLx的优秀开源项目:LxGridView
  8. github链接:https://github.com/DeveloperLx/LxGridView
  9. 我对这个类的代码做了一些修改;
  10. 感谢DeveloperLx的优秀代码~
  11. */
  12. @interface LxGridViewFlowLayout : UICollectionViewFlowLayout
  13. @property (nonatomic,assign) BOOL panGestureRecognizerEnable;
  14. @end
  15. @protocol LxGridViewDataSource <UICollectionViewDataSource>
  16. @optional
  17. - (void)collectionView:(UICollectionView *)collectionView
  18. itemAtIndexPath:(NSIndexPath *)sourceIndexPath
  19. willMoveToIndexPath:(NSIndexPath *)destinationIndexPath;
  20. - (void)collectionView:(UICollectionView *)collectionView
  21. itemAtIndexPath:(NSIndexPath *)sourceIndexPath
  22. didMoveToIndexPath:(NSIndexPath *)destinationIndexPath;
  23. - (BOOL)collectionView:(UICollectionView *)collectionView
  24. canMoveItemAtIndexPath:(NSIndexPath *)indexPath;
  25. - (BOOL)collectionView:(UICollectionView *)collectionView
  26. itemAtIndexPath:(NSIndexPath *)sourceIndexPath
  27. canMoveToIndexPath:(NSIndexPath *)destinationIndexPath;
  28. @end
  29. @protocol LxGridViewDelegateFlowLayout <UICollectionViewDelegateFlowLayout>
  30. @optional
  31. - (void)collectionView:(UICollectionView *)collectionView
  32. layout:(UICollectionViewLayout *)collectionViewLayout
  33. willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
  34. - (void)collectionView:(UICollectionView *)collectionView
  35. layout:(UICollectionViewLayout *)collectionViewLayout
  36. didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
  37. - (void)collectionView:(UICollectionView *)collectionView
  38. layout:(UICollectionViewLayout *)collectionViewLayout
  39. willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
  40. - (void)collectionView:(UICollectionView *)collectionView
  41. layout:(UICollectionViewLayout *)collectionViewLayout
  42. didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
  43. @end