UICollectionView:支持在iOS 8上重新排序

时间:2016-02-16 13:18:37

标签: ios swift ios8 uicollectionview ios9

所以我在我的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()

1 个答案:

答案 0 :(得分:0)

我已经使用LXReorderableCollectionViewFlowLayout重新排序iOS 9之前的应用中的集合视图。工作得很好。

LXReorderableCollectionViewFlowLayout

只需要实现一些委托调用并将其用作集合视图布局。