RAReorderableLayout

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

  • 所有者: ra1028/RAReorderableLayout
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者ra1028/RAReorderableLayout
主编程语言Swift
编程语言Swift (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2014-12-03 10:28:40
推送于2019-03-29 01:57:32
最后一次提交2016-11-09 11:53:39
发布数8
最新版本名称0.6.1 (发布于 2016-09-26 23:06:46)
第一版名称0.1.0 (发布于 2015-04-19 14:11:00)
用户参与
星数866
关注者数31
派生数138
提交数92
已启用问题?
问题数31
打开的问题数26
拉请求数15
打开的拉请求数10
关闭的拉请求数6
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?