---
title: "collectionView(_:targetIndexPathForMoveFromItemAt:toProposedIndexPath:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewdelegate/collectionview(_:targetindexpathformovefromitemat:toproposedindexpath:)"
---

# collectionView(_:targetIndexPathForMoveFromItemAt:toProposedIndexPath:)

Asks the delegate for the index path to use when moving an item.

## Declaration

```swift
optional func collectionView(_ collectionView: UICollectionView, targetIndexPathForMoveFromItemAt currentIndexPath: IndexPath, toProposedIndexPath proposedIndexPath: IndexPath) -> IndexPath
```

## Parameters

- `collectionView`: The collection view making the request.
- `currentIndexPath`: The item’s original index path.
- `proposedIndexPath`: The proposed index path of the item.

## Return Value

Return Value The index path you want to use for the item. If you do not implement this method, the collection view uses the index path in the proposedIndexPath parameter.

## Discussion

Discussion During the interactive moving of an item, the collection view calls this method to see if you want to provide a different index path than the proposed path. You might use this method to prevent the user from dropping the item in an invalid location. For example, you might prevent the user from dropping the item in a specific section.

## See Also

### Deprecated

- [collectionView(_:contextMenuConfigurationForItemAt:point:)](uikit/uicollectionviewdelegate/collectionview(_:contextmenuconfigurationforitemat:point:).md)
- [collectionView(_:previewForDismissingContextMenuWithConfiguration:)](uikit/uicollectionviewdelegate/collectionview(_:previewfordismissingcontextmenuwithconfiguration:).md)
- [collectionView(_:previewForHighlightingContextMenuWithConfiguration:)](uikit/uicollectionviewdelegate/collectionview(_:previewforhighlightingcontextmenuwithconfiguration:).md)
- [collectionView(_:shouldShowMenuForItemAt:)](uikit/uicollectionviewdelegate/collectionview(_:shouldshowmenuforitemat:).md)
- [collectionView(_:canPerformAction:forItemAt:withSender:)](uikit/uicollectionviewdelegate/collectionview(_:canperformaction:foritemat:withsender:).md)
- [collectionView(_:performAction:forItemAt:withSender:)](uikit/uicollectionviewdelegate/collectionview(_:performaction:foritemat:withsender:).md)
