---
title: "item(at:didMoveTo:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsfilecoordinator/item(at:didmoveto:)"
---

# item(at:didMoveTo:)

Notifies relevant file presenters that the location of a file or directory changed.

## Declaration

```swift
func item(at oldURL: URL, didMoveTo newURL: URL)
```

## Parameters

- `oldURL`: The old location of the file or directory.
- `newURL`: The new location of the file or directory.

## Discussion

Discussion If you move or rename a file or directory as part of a write operation, call this method to notify relevant file presenters that the change occurred. This method calls the presentedItemDidMove(to:) method for any of the item’s file presenters.  If the item is a directory, this method calls presentedItemDidMove(to:) on the file presenters for the item’s contents. Finally, it calls presentedSubitem(at:didMoveTo:) on the file presenter of any directory containing the item. You must call this method from a coordinated write block. Calling this method with the same URL in the oldURL and newURL parameters is harmless. This call must balance a call to item(at:willMoveTo:).

## See Also

### Coordinating File Operations Synchronously

- [coordinate(readingItemAt:options:error:byAccessor:)](foundation/nsfilecoordinator/coordinate(readingitemat:options:error:byaccessor:).md)
- [coordinate(writingItemAt:options:error:byAccessor:)](foundation/nsfilecoordinator/coordinate(writingitemat:options:error:byaccessor:).md)
- [coordinate(readingItemAt:options:writingItemAt:options:error:byAccessor:)](foundation/nsfilecoordinator/coordinate(readingitemat:options:writingitemat:options:error:byaccessor:).md)
- [coordinate(writingItemAt:options:writingItemAt:options:error:byAccessor:)](foundation/nsfilecoordinator/coordinate(writingitemat:options:writingitemat:options:error:byaccessor:).md)
- [prepare(forReadingItemsAt:options:writingItemsAt:options:error:byAccessor:)](foundation/nsfilecoordinator/prepare(forreadingitemsat:options:writingitemsat:options:error:byaccessor:).md)
- [item(at:willMoveTo:)](foundation/nsfilecoordinator/item(at:willmoveto:).md)
- [cancel()](foundation/nsfilecoordinator/cancel().md)
