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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?