RAReorderableLayout

A UICollectionView layout whitch can move item with drag and drop.

  • Owner: ra1028/RAReorderableLayout
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

RAReorderableLayout

A UICollectionView layout which you can move items with drag and drop.

Screen shots

screen shot1
screen shot2

Animation

animated 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 instead.

Installation

iOS8 or later

CocoaPods

# Podfile  
use_frameworks!  

target 'YOUR_TARGET_NAME' do
  pod 'RAReorderableLayout'
end

Carthage

 # 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) -> Bool

optional 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.

Main metrics

Overview
Name With Ownerra1028/RAReorderableLayout
Primary LanguageSwift
Program languageSwift (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2014-12-03 10:28:40
Pushed At2019-03-29 01:57:32
Last Commit At2016-11-09 11:53:39
Release Count8
Last Release Name0.6.1 (Posted on 2016-09-26 23:06:46)
First Release Name0.1.0 (Posted on 2015-04-19 14:11:00)
用户参与
Stargazers Count866
Watchers Count31
Fork Count138
Commits Count92
Has Issues Enabled
Issues Count31
Issue Open Count26
Pull Requests Count15
Pull Requests Open Count10
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private