RAReorderableLayout 0.6.1

RAReorderableLayout 0.6.1

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2016年9月
SPM支持 SPM

ra1028 维护。



  • ra1028

RAReorderableLayout

一个支持通过拖放移动项目的 UICollectionView 布局。

屏幕截图

screen shot1 screen shot2

动画

animated gif

需求

  • Swift 3.0 / Xcode 8
    OS X 10.9 或更高版本 iOS 8.0 或更高版本 watchOS 2.0 或更高版本 tvOS 9.0 或更高版本

仍然想使用 swift2.2 或 2.3 吗?
-> 您可以使用 0.5.0

安装

iOS8 或更高版本

使用方法

设置集合视图以使用 RAReorderableLayout。
您必须在 RAReorderableLayoutDelegate 协议中重新排序单元格信息数组以支持重新排序功能。
具体请参考示例项目。

协议

委托

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)

数据源

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

许可证

RAReorderableLayout 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。