cell InterativeMovement
-
CollectionView Cell 이동 시키기 (1) - 기존 방식과 custom InteractiveMovementiOS 2022. 6. 9. 20:13
보통 CollectoinView의 cell을 이동하기 위해선 gesture을 붙이고 cell의 location을 이용하여 위치를 바꾼 후 해당 model의 데이터를 스왑해준다. @objc func handleLongPressGesture() { let location = longPress.location(in: collectionView) switch longPress.state { case .began: if let indexPath = collectionView.indexPathForItem(at: location) { collectionView.beginInteractiveMovementForItem(at: indexPath) } case .changed: collectionView.updateIn..