---
title: inferringMoves()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/collectiondifference/inferringmoves()
---

# inferringMoves()

Returns a new collection difference with associations between individual elements that have been removed and inserted only once.

## Declaration

```swift
func inferringMoves() -> CollectionDifference<ChangeElement>
```

## Return Value

Return Value A collection difference with all possible moves inferred.

## Discussion

Discussion note: O(n) where n is the number of collection differences.
