RACollectionViewReorderableTripletLayout 0.1.0

RACollectionViewReorderableTripletLayout 0.1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布时间最新发布Dec 2014

ra1028 维护。



  • ra1028

可以通过拖动它来执行单元格重新排序的自定义 collectionView 布局。

我创建了一个新的 awesome UICollectionView 可重新排序布局 !!

查看它 !!

功能

  • 通过长按并拖动来重新排序单元格 !
  • 您可以接收一些拖动事件的通知。
  • 抱歉,没有支持水平滚动收藏视图。
  • 两个或更多部分也不支持... 支持 !

请,给我发送 pull request !

屏幕截图

screen shot1 screen shot2

动画

animated gif

安装

使用

将 RACollectionViewReorderableTripletLayout 添加到您的收藏视图中,然后设置代理和数据源。

self.collectionView.delegate = self;
self.collectionView.dataSource = self;

代理和数据源

TripletLayout

- (CGSize)collectionView:(UICollectionView *)collectionView sizeForLargeItemsInSection:(NSInteger)section; //Default to automaticaly grow square !
- (UIEdgeInsets)insetsForCollectionView:(UICollectionView *)collectionView;
- (CGFloat)sectionSpacingForCollectionView:(UICollectionView *)collectionView;
- (CGFloat)minimumInteritemSpacingForCollectionView:(UICollectionView *)collectionView;
- (CGFloat)minimumLineSpacingForCollectionView:(UICollectionView *)collectionView;

ReorderableTripletLayout

- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath;
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath didMoveToIndexPath:(NSIndexPath *)toIndexPath;

- (BOOL)collectionView:(UICollectionView *)collectionView canMoveItemAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath canMoveToIndexPath:(NSIndexPath *)toIndexPath;
- (CGFloat)reorderingItemAlpha:(UICollectionView * )collectionview; //Default 0.
- (UIEdgeInsets)autoScrollTrigerEdgeInsets:(UICollectionView *)collectionView; //Sorry, has not supported horizontal scroll.
- (UIEdgeInsets)autoScrollTrigerPadding:(UICollectionView *)collectionView;

- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;

许可证

RACollectionViewReorderableTripletLayout 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。