collectionView(_:canMoveItemAt:)
Asks your data source object whether the specified item can move to another location in the collection view.
Declaration
optional func collectionView(_ collectionView: UICollectionView, canMoveItemAt indexPath: IndexPath) -> BoolParameters
- collectionView:
The collection view requesting this information.
- indexPath:
The index path of the item that the collection view is trying to move.
Return Value
Discussion
Use this method to selectively allow or disallow the movement of items within a collection view. If you don’t implement this method, but you do implement the collectionView(_:moveItemAt:to:) method, the collection view allows all items to be reordered.