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

# fileDialogDefaultDirectory(_:)

Configures the `fileExporter`, `fileImporter`, or `fileMover` to
open with the specified default directory.

```
nonisolated func fileDialogDefaultDirectory(_ defaultDirectory: URL?) -> some View
```

## Parameters

`defaultDirectory`

The directory to show when
the system file dialog launches. If the given file dialog has
a `fileDialogCustomizationID` if stores the user-chosen directory and subsequently
opens with it, ignoring the default value provided in this modifier.

---

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)