所以我正在我的 Swift 应用程序中处理 UICollectionView 重新排序。我发现 iOS9 的新功能可以很好地完成工作。
我意识到它必须在 >= iOS9 设备上运行,并且我的应用程序必须与 iOS8 兼容。
有谁知道我应该用什么来代替它们?
@available(iOS 9.0, *)
public func beginInteractiveMovementForItemAtIndexPath(indexPath: NSIndexPath) -> Bool // returns NO if reordering was prevented from beginning - otherwise YES
@available(iOS 9.0, *)
public func updateInteractiveMovementTargetPosition(targetPosition: CGPoint)
@available(iOS 9.0, *)
public func endInteractiveMovement()
@available(iOS 9.0, *)
public func cancelInteractiveMovement()
最佳答案
我使用 LXReorderableCollectionViewFlowLayout 在 iOS 9 之前的应用程序中重新排序 Collection View 。效果相当不错。
LXReorderableCollectionViewFlowLayout
只需实现一些委托(delegate)调用并将其用作 Collection View 布局。
关于ios - UICollectionView : Support for reordering on iOS 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35433719/