Skip to content

swiftuilib/document-picker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%