---
title: "fileManager(_:shouldMoveItemAt:to:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/filemanagerdelegate/filemanager(_:shouldmoveitemat:to:)"
---

# fileManager(_:shouldMoveItemAt:to:)

Asks the delegate if the file manager should move the specified item to the new URL.

## Declaration

```swift
optional func fileManager(_ fileManager: FileManager, shouldMoveItemAt srcURL: URL, to dstURL: URL) -> Bool
```

## Parameters

- `fileManager`: The file manager object that is attempting to move the file or directory.
- `srcURL`: The URL of the file or directory that the file manager wants to move.
- `dstURL`: The URL specifying the new location for the file or directory.

## Return Value

Return Value true if the item should be moved or false if it should not be moved. If you do not implement this method, the file manager assumes a response of true.

## Discussion

Discussion This method is called only once for the item being moved, regardless of whether the item is a file, directory, or symbolic link. This method performs the same task as the fileManager(_:shouldMoveItemAtPath:toPath:) method and is preferred over that method in macOS 10.6 and later.

## See Also

### Related Documentation

- [moveItem(atPath:toPath:)](foundation/filemanager/moveitem(atpath:topath:).md)
- [moveItem(at:to:)](foundation/filemanager/moveitem(at:to:).md)

### Moving  an Item

- [fileManager(_:shouldMoveItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldmoveitematpath:topath:).md)
- [fileManager(_:shouldProceedAfterError:movingItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:movingitemat:to:).md)
- [fileManager(_:shouldProceedAfterError:movingItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:movingitematpath:topath:).md)
