Extends `UICollectionViewFlowLayout` to support reordering of cells. Similar to long press and pan on books in iBook.
See the codeExtends UICollectionViewFlowLayout to support reordering of cells. Similar to long press and pan on books in iBook.
The goal of LXReorderableCollectionViewFlowLayout is to provides capability for reordering of cell, similar to iBook.
Install using CocoaPods or drag the LXReorderableCollectionViewFlowLayout folder into your project.
Initialize/Setup your collection view to use LXReorderableCollectionViewFlowLayout.
The collection view controller that is to support reordering capability must conforms to LXReorderableCollectionViewDataSource protocol. For example,
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath {
id object = [mutableArray objectAtIndex:fromIndexPath.item];
[mutableArray removeObjectAtIndex:fromIndexPath.item];
[mutableArray insertObject:object atIndex:toIndexPath.item];
}
You can listen to some dragging events through comforming to LXReorderableCollectionViewDelegateFlowLayout methods.
Setup your collection view accordingly to your need, run and see it in action! :D
LXReorderableCollectionViewFlowLayout is available under the MIT license.
2,262 followers · starred Jul 2014
385 followers · starred Sep 2015
132 followers · starred Dec 2019
69 followers · starred May 2016
Extends `UICollectionViewFlowLayout` to support reordering of cells. Similar to long press and pan on books in iBook.
See the codeExtends UICollectionViewFlowLayout to support reordering of cells. Similar to long press and pan on books in iBook.
The goal of LXReorderableCollectionViewFlowLayout is to provides capability for reordering of cell, similar to iBook.
Install using CocoaPods or drag the LXReorderableCollectionViewFlowLayout folder into your project.
Initialize/Setup your collection view to use LXReorderableCollectionViewFlowLayout.
The collection view controller that is to support reordering capability must conforms to LXReorderableCollectionViewDataSource protocol. For example,
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath {
id object = [mutableArray objectAtIndex:fromIndexPath.item];
[mutableArray removeObjectAtIndex:fromIndexPath.item];
[mutableArray insertObject:object atIndex:toIndexPath.item];
}
You can listen to some dragging events through comforming to LXReorderableCollectionViewDelegateFlowLayout methods.
Setup your collection view accordingly to your need, run and see it in action! :D
LXReorderableCollectionViewFlowLayout is available under the MIT license.
2,262 followers · starred Jul 2014
385 followers · starred Sep 2015
132 followers · starred Dec 2019
69 followers · starred May 2016