Swiftpack.co - msalmonse/FilePicker as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by msalmonse.
msalmonse/FilePicker 0.2.1
Wrapper for UIDocumentPickerViewController
⭐️ 4
🕓 2 years ago
.package(url: "https://github.com/msalmonse/FilePicker.git", from: "0.2.1")

FilePicker

Wrapper for UIDocumentPickerViewController

Updated for iOS 14, currently works though not well.

My testbed ContentView:

struct ContentView: View {
    @ObservedObject
    var state = FilePickerState().showFileExtensions(true)
    @State
    var path = "Not Set"
    @State
    var showPicker = false
    @State
    var multi = false

    var body: some View {
        VStack {
            Button("Pick file") {
                self.showPicker = true
            }
            .sheet(isPresented: self.$showPicker) {
                FilePickerView(state, showToggles: true)
            }
            Text("Path: \(path)")
                .onReceive(state.urlPublisher, perform: { self.path = $0.path })
        }
    }
}

GitHub

link
Stars: 4
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics