lxcid/LXReorderableCollectionViewFlowLayout
lxcid/LXReorderableCollectionViewFlowLayout has 1,842 GitHub stars and 315 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-08 01:11 UTC. Last push 2019-03-08.
Extends `UICollectionViewFlowLayout` to support reordering of cells. Similar to long press and pan on books in iBook.
What you can do
- Long press on cell to invoke reordering capability.
- When reordering capability is invoked, fade the selected cell from highlighted to normal state.
- Drag around the selected cell to move it to the desired location, the other cells adjust accordingly. Callback in the form of delegate methods are invoked.
- Drag selected cell to the edges, depending on scroll direction, scroll in the desired direction.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalLXReorderableCollectionViewFlowLayout
Extends UICollectionViewFlowLayout to support reordering of cells. Similar to long press and pan on books in iBook.
Features
The goal of LXReorderableCollectionViewFlowLayout is to provides capability for reordering of cell, similar to iBook.
- Long press on cell to invoke reordering capability.
- When reordering capability is invoked, fade the selected cell from highlighted to normal state.
- Drag around the selected cell to move it to the desired location, the other cells adjust accordingly. Callback in the form of delegate methods are invoked.
- Drag selected cell to the edges, depending on scroll direction, scroll in the desired direction.
- Release to stop reordering.
Getting Started

Install using CocoaPods or drag the
LXReorderableCollectionViewFlowLayoutfolder into your project.Initialize/Setup your collection view to use
LXReorderableCollectionViewFlowLayout.The collection view controller that is to support reordering capability must conforms to
LXReorderableCollectionViewDataSourceprotocol. 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
LXReorderableCollectionViewDelegateFlowLayoutmethods.Setup your collection view accordingly to your need, run and see it in action! :D
Changes
Feb 24 2013 (Luke Scott)
- Removed setUpGestureRecognizersOnCollectionView
- Removed layout from delegate methods (can be accessed from collectionView)
- Renamed delegate methods and split between dataSource and delegate
- Added dataSource and delegate examples to sample project
Feb 23 2013 (Luke Scott)
- Refactored everything to be more readable / maintainable
- Deprecated setUpGestureRecognizersOnCollectionView - no longer necessary
Requirements
- ARC
- iOS 6 and above preferred
- Xcode 4.5 and above
Credits
- Originally created by Stan Chang Khin Boon (Github: @lxcid, Twitter: @lxcid, Google+: +Stan Chang Khin Boon) for buUuk, with reference to MaximilianL's implementation on Apple Developer Forums.
- Refactored by Luke Scott, with some help from mulle-nat's fork.
- Playing cards in the demo are downloaded from http://www.jfitz.com/cards/.
Alternatives
License
LXReorderableCollectionViewFlowLayout is available under the MIT license.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,927 starspublic-apis/public-apis
A collective list of free APIs
497,176 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
442,406 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,177 stars