Skip to content

About

No description, website, or topics provided.

Resources

Stars

21 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

DocumentPicker is a SwiftUI view modifier to show/hide the system's document picker. Fully compatible with the macOS, iOS, iPadOS and Mac Catalyst platforms.

Demo

Example

struct ContentView: View {

  @State var showDocPicker = false

  var body: some View {
    Button("Show document picker") {
      self.showDocPicker.toggle()
    }
    .documentPicker(
      isPresented: $showDocPicker,
      documentTypes: ["public.folder"],
    ) { urls in
      print("Selected folder: \(urls.first!)")
    }
  }
}

More info in the docs.

Installation via SPM

In XCode add the following URL to your project's Swift Package dependencies:

https://github.com/swiftuilib/document-picker

Development

To modify the package contents while still being able to see SwiftUI Previews use the provided DocumentPickerPreview.xcodeproj.

About

No description, website, or topics provided.

Resources

Stars

21 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages