Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ra1028/RAReorderableLayout
A UICollectionView layout whitch can move item with drag and drop.
https://github.com/ra1028/RAReorderableLayout
Last synced: about 2 months ago
JSON representation
A UICollectionView layout whitch can move item with drag and drop.
- Host: GitHub
- URL: https://github.com/ra1028/RAReorderableLayout
- Owner: ra1028
- License: mit
- Archived: true
- Created: 2014-12-03T10:28:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T01:57:32.000Z (over 5 years ago)
- Last Synced: 2024-09-19T04:33:26.609Z (3 months ago)
- Language: Swift
- Size: 39 MB
- Stars: 867
- Watchers: 32
- Forks: 140
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cocoa - RAReorderableLayout
README
RAReorderableLayout
=======================#### A UICollectionView layout which you can move items with drag and drop.
## Screen shots
![screen shot1](https://github.com/ra1028/RAReorderableLayout/raw/master/Assets/screenshot1.png)
![screen shot2](https://github.com/ra1028/RAReorderableLayout/raw/master/Assets/screenshot2.png)## Animation
![animated gif](https://github.com/ra1028/RAReorderableLayout/raw/master/Assets/animation.gif)## Requirements
- Swift 3.0 / Xcode 8
OS X 10.9 or later
iOS 8.0 or later
watchOS 2.0 or later
tvOS 9.0 or later_Still wanna use swift2.2 or 2.3?_
-> You can use [0.5.0](https://github.com/ra1028/RAReorderableLayout/tree/0.5.0) instead.## Installation
__iOS8 or later__### CocoaPods
```ruby
# Podfile
use_frameworks!target 'YOUR_TARGET_NAME' do
pod 'RAReorderableLayout'
end```
### Carthage
```ruby
# Cartfile
github "ra1028/RAReorderableLayout"
```## Usage
Setup your collection view to use RAReorderableLayout.
You must reorder cells information array in RAReorderableLayoutDelegate protocol to support reordering capability.
Specifically, please refer to Demo-project.## Protocol
Delegate
```
optional func collectionView(collectionView: UICollectionView, atIndexPath: NSIndexPath, willMoveToIndexPath toIndexPath: NSIndexPath)
optional func collectionView(collectionView: UICollectionView, atIndexPath: NSIndexPath, didMoveToIndexPath toIndexPath: NSIndexPath)optional func collectionView(collectionView: UICollectionView, allowMoveAtIndexPath indexPath: NSIndexPath) -> Bool
optional func collectionView(collectionView: UICollectionView, atIndexPath: NSIndexPath, canMoveToIndexPath: NSIndexPath) -> Booloptional func collectionView(collectionView: UICollectionView, collectionViewLayout layout: RAReorderableLayout, willBeginDraggingItemAtIndexPath indexPath: NSIndexPath)
optional func collectionView(collectionView: UICollectionView, collectionViewLayout layout: RAReorderableLayout, didBeginDraggingItemAtIndexPath indexPath: NSIndexPath)
optional func collectionView(collectionView: UICollectionView, collectionViewLayout layout: RAReorderableLayout, willEndDraggingItemToIndexPath indexPath: NSIndexPath)
optional func collectionView(collectionView: UICollectionView, collectionViewLayout layout: RAReorderableLayout, didEndDraggingItemToIndexPath indexPath: NSIndexPath)
```Datasource
```
optional func collectionView(collectionView: UICollectionView, reorderingItemAlphaInSection section: Int) -> CGFloat
optional func scrollTrigerEdgeInsetsInCollectionView(collectionView: UICollectionView) -> UIEdgeInsets
optional func scrollTrigerPaddingInCollectionView(collectionView: UICollectionView) -> UIEdgeInsets
optional func scrollSpeedValueInCollectionView(collectionView: UICollectionView) -> CGFloat
```## License
RAReorderableLayout is available under the MIT license. See the LICENSE file for more info.