<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/fileMover(isPresented:files:onCompletion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE9fileMover11isPresented5files12onCompletionQrAA7BindingVySbG_qd__ys6ResultOySay10Foundation3URLVGs5Error_pGctSlRd__AO7ElementRtd__lF"
  },
  "title" : "fileMover(isPresented:files:onCompletion:)"
}
-->

# fileMover(isPresented:files:onCompletion:)

Presents a system dialog for allowing the user to move a collection
of existing files to a new location.

```
nonisolated func fileMover<C>(isPresented: Binding<Bool>, files: C, onCompletion: @escaping (Result<[URL], any Error>) -> Void) -> some View where C : Collection, C.Element == URL
```

## Parameters

`isPresented`

A binding to whether the dialog should be shown.

`files`

A collection of `URL`s for the files to be moved.

`onCompletion`

A callback that will be invoked when the operation has
has succeeded or failed. To access the received URLs, call `startAccessingSecurityScopedResource`.
When the access is no longer required, call `stopAccessingSecurityScopedResource`.

- result: A `Result` indicating whether the operation succeeded or
  failed.

## Discussion> Note: This dialog provides security-scoped URLs.
> Call the ``startAccessingSecurityScopedResource`` method to access or bookmark
> the URLs, and the ``stopAccessingSecurityScopedResource`` method
> to release the access.

To further configure the dialog’s appearance and behavior, use these
view modifiers: [`fileDialogDefaultDirectory(_:)`](/documentation/SwiftUI/View/fileDialogDefaultDirectory(_:)),
[`fileDialogConfirmationLabel(_:)`](/documentation/SwiftUI/View/fileDialogConfirmationLabel(_:)), [`fileDialogMessage(_:)`](/documentation/SwiftUI/View/fileDialogMessage(_:)),
[`fileDialogBrowserOptions(_:)`](/documentation/SwiftUI/View/fileDialogBrowserOptions(_:)), [`fileDialogURLEnabled(_:)`](/documentation/SwiftUI/View/fileDialogURLEnabled(_:)),
[`fileDialogImportsUnresolvedAliases(_:)`](/documentation/SwiftUI/View/fileDialogImportsUnresolvedAliases(_:)), and
[`fileDialogCustomizationID(_:)`](/documentation/SwiftUI/View/fileDialogCustomizationID(_:)).

In order for the dialog to appear, both `isPresented` must be `true`
and `files` must not be empty. When the operation is finished,
`isPresented` will be set to `false` before `onCompletion` is called. If
the user cancels the operation, `isPresented` will be set to `false` and
`onCompletion` will not be called.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)