---
title: "enumerateMoves(_:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phfetchresultchangedetails/enumeratemoves(_:)"
---

# enumerateMoves(_:)

Runs the specified block for each case where an object has moved from one index to another in the fetch result.

## Declaration

```swift
func enumerateMoves(_ handler: @escaping (Int, Int) -> Void)
```

## Parameters

- `handler`: A block that Photos calls to provide details about which objects in the fetch result have moved to which indexes. The block takes the following parameters:

## Discussion

Discussion The toIndex parameter in the handler block is relative to the state of the fetch result after you’ve applied the changes described by the removedIndexes, insertedIndexes and changedIndexes properties. Therefore, if you use this method to update a collection view or similar user interface displaying the contents of the fetch result, update your UI to reflect insertions, removals, and changes before you process moves.

## See Also

### Getting Change Information

- [hasIncrementalChanges](photos/phfetchresultchangedetails/hasincrementalchanges.md)
- [removedIndexes](photos/phfetchresultchangedetails/removedindexes.md)
- [removedObjects](photos/phfetchresultchangedetails/removedobjects.md)
- [insertedIndexes](photos/phfetchresultchangedetails/insertedindexes.md)
- [insertedObjects](photos/phfetchresultchangedetails/insertedobjects.md)
- [changedIndexes](photos/phfetchresultchangedetails/changedindexes.md)
- [changedObjects](photos/phfetchresultchangedetails/changedobjects.md)
- [hasMoves](photos/phfetchresultchangedetails/hasmoves.md)
