快速拖放collectionViewCell

时间:2019-06-19 16:48:50

标签: ios swift uicollectionview drag-and-drop

每当我在其他部分中将单元格拖放到崩溃时,当我在同一部分中拖放单元格时,任何修复方法的想法都很好,在此先谢谢了。下面是完整的代码。

//错误:由于未捕获的异常“ NSInternalInconsistencyException”而终止应用程序,原因:“试图将第21项插入第1部分,但更新后只有1个部分”

// ViewController

if

1 个答案:

答案 0 :(得分:0)

您必须使用beginInteractiveMovementForItemAtIndexPath:endInteractiveMovement

请参见UICollectionView referenceReordering Items Interactively部分