Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ra1028/RACollectionViewReorderableTripletLayout
The custom collectionView layout that can perform reordering of cells by dragging it.
https://github.com/ra1028/RACollectionViewReorderableTripletLayout
Last synced: about 1 month ago
JSON representation
The custom collectionView layout that can perform reordering of cells by dragging it.
- Host: GitHub
- URL: https://github.com/ra1028/RACollectionViewReorderableTripletLayout
- Owner: ra1028
- License: mit
- Created: 2014-05-31T02:06:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-07T21:23:38.000Z (over 9 years ago)
- Last Synced: 2024-10-15T02:41:15.228Z (about 2 months ago)
- Language: Objective-C
- Homepage:
- Size: 10.5 MB
- Stars: 1,481
- Watchers: 50
- Forks: 192
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mobile-ui - ra1028/RACollectionViewReorderableTripletLayout
README
RACollectionViewReorderableTripletLayout
=======================#### The custom collectionView layout that can perform reordering of cells by dragging it.
### I created a new awesome UICollectionView reorderable layout !
#### [Check it out !!](https://github.com/ra1028/RAReorderableLayout)## Features
- Reorder cells by long pressing and dragging it !
- You can Receive notification to some dragging events.
- Sorry, has not supported horizontal scroll collection view.
- ~~Sections two or more are also not supported...~~ __Supported !__#### Please, send me pull request !
## Screen shots
![screen shot1](https://github.com/ra1028/RACollectionViewReorderableTripletLayout/raw/master/Assets/screenshot1.png)
![screen shot2](https://github.com/ra1028/RACollectionViewReorderableTripletLayout/raw/master/Assets/screenshot2.png)## Animation
![animated gif](https://github.com/ra1028/RACollectionViewReorderableTripletLayout/raw/master/Assets/animation.gif)## Installation
RACollectionViewReorderableTripletLayout is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:pod "RACollectionViewReorderableTripletLayout"
## Usage
Add RACollectionViewReorderableTripletLayout to your collection view, then set delegate and datasource.
```Objective-C
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
```## Delegates and Datasource
#### TripletLayout
```Objective-C
- (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
```Objective-C
- (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;
``````Objective-c
- (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;
```## License
RACollectionViewReorderableTripletLayout is available under the MIT license. See the LICENSE file for more info.