{"id":25085535,"url":"https://github.com/0xwdg/filepicker","last_synced_at":"2026-05-07T08:40:03.451Z","repository":{"id":275263235,"uuid":"925361489","full_name":"0xWDG/FilePicker","owner":"0xWDG","description":"FilePicker is a SwiftUI view modifier that allows you to open a file picker and open or save a file from the user's device.","archived":false,"fork":false,"pushed_at":"2025-03-06T19:24:44.000Z","size":309,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T18:19:18.479Z","etag":null,"topics":["0xwdg","filepicker","ios","macos","swift","swiftlang","swiftpm","swiftui"],"latest_commit_sha":null,"homepage":"https://0xwdg.github.io/FilePicker/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xWDG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"0xWDG"}},"created_at":"2025-01-31T18:24:01.000Z","updated_at":"2025-03-06T19:23:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ad86891-4e30-4823-993c-dbc7944abf8b","html_url":"https://github.com/0xWDG/FilePicker","commit_stats":null,"previous_names":["0xwdg/filepicker"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FFilePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FFilePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FFilePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FFilePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xWDG","download_url":"https://codeload.github.com/0xWDG/FilePicker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644240,"owners_count":20810745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0xwdg","filepicker","ios","macos","swift","swiftlang","swiftpm","swiftui"],"created_at":"2025-02-07T08:20:15.972Z","updated_at":"2026-05-07T08:40:03.412Z","avatar_url":"https://github.com/0xWDG.png","language":"Swift","funding_links":["https://github.com/sponsors/0xWDG"],"categories":[],"sub_categories":[],"readme":"# FilePicker\n\nFilePicker is a SwiftUI view modifier that allows you to open a file picker and open or save a file from the user's device.\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2F0xWDG%2FFilePicker%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/0xWDG/FilePicker)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2F0xWDG%2FFilePicker%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/0xWDG/FilePicker)\n[![Swift Package Manager](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager)\n![License](https://img.shields.io/github/license/0xWDG/FilePicker)\n\n## Requirements\n\n- Swift 5.9+ (Xcode 15+)\n- iOS 15+, macOS 12+\n\n## Installation (Pakage.swift)\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/0xWDG/FilePicker.git\", branch: \"main\"),\n],\ntargets: [\n    .target(name: \"MyTarget\", dependencies: [\n        .product(name: \"FilePicker\", package: \"FilePicker\"),\n    ]),\n]\n```\n\n## Installation (Xcode)\n\n1. In Xcode, open your project and navigate to **File** → **Swift Packages** → **Add Package Dependency...**\n2. Paste the repository URL (`https://github.com/0xWDG/FilePicker`) and click **Next**.\n3. Click **Finish**.\n\n## Usage (Open file)\n\n```swift\nimport SwiftUI\nimport FilePicker\n\nstruct ContentView: View {\n    // MARK: Filepicker\n    @State var filePickerOpen = false\n    @State var filePickerFiles: [URL] = []\n\n    var body: some View {\n        VStack {\n            Text(\"Open a file :)\")\n                .padding()\n\n            Button(\"Open\", systemImage: \"square.and.arrow.down\") {\n                filePickerOpen.toggle()\n            }\n\n            ForEach(filePickerFiles, id: \\.self) { file in\n                Text(file.lastPathComponent)\n            }\n        }\n        .padding()\n        .filePicker(\n            isPresented: $filePickerOpen,\n            files: $filePickerFiles,\n            types: [.json, .text], // Optional (default: .json)\n            allowsMultipleSelection: false // Optional (default: false)\n        )\n        .onChange(of: $filePickerFiles.wrappedValue) { newValue in\n            print(newValue)\n        }\n    }\n}\n```\n\n## Usage (Save file)\n\n```swift\nimport SwiftUI\nimport FilePicker\n\nstruct ContentView: View {\n    // MARK: Filepicker\n    @State var filePickerOpen = false\n    var filePickerFileName = \"test.txt\"\n    var filePickerData = Data(\"Hello, World!\".utf8)\n\n    var body: some View {\n        VStack {\n            Text(\"Save a file :)\")\n                .padding()\n\n            Button(\"Save\", systemImage: \"square.and.arrow.up\") {\n                filePickerOpen.toggle()\n            }\n        }\n        .padding()\n        .filePicker(\n            isPresented: $filePickerOpen,\n            fileName: filePickerFileName,\n            data: filePickerData,\n            types: [.text]\n        )\n    }\n}\n```\n\n## Contact\n\n🦋 [@0xWDG](https://bsky.app/profile/0xWDG.bsky.social)\n🐘 [mastodon.social/@0xWDG](https://mastodon.social/@0xWDG)\n🐦 [@0xWDG](https://x.com/0xWDG)\n🧵 [@0xWDG](https://www.threads.net/@0xWDG)\n🌐 [wesleydegroot.nl](https://wesleydegroot.nl)\n🤖 [Discord](https://discordapp.com/users/918438083861573692)\n\nInterested learning more about Swift? [Check out my blog](https://wesleydegroot.nl/blog/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xwdg%2Ffilepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xwdg%2Ffilepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xwdg%2Ffilepicker/lists"}