Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/audulus/filebrowser
Alternate document browser for document apps
https://github.com/audulus/filebrowser
ios swiftui uidocumentbrowserviewcontroller
Last synced: 3 months ago
JSON representation
Alternate document browser for document apps
- Host: GitHub
- URL: https://github.com/audulus/filebrowser
- Owner: audulus
- License: mit
- Created: 2024-10-14T21:11:50.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-30T00:52:20.000Z (3 months ago)
- Last Synced: 2024-10-30T02:55:21.322Z (3 months ago)
- Topics: ios, swiftui, uidocumentbrowserviewcontroller
- Language: Swift
- Homepage:
- Size: 457 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FileBrowser
`UIDocumentBrowserViewController` (aka `DocumentGroup` in SwiftUI) is overwrought, buggy, is confused with the Files app, and forces you into having a title bar when opening a document. No wonder apps like Procreate make their own. This is an attempt to replicate the browser in Procreate.
This is far from complete, but I will be using it in both of my already-released apps and one upcoming app.
![Screenshot](screenshot.png)
## Usage
```swift
@main
struct MyApp: App {
@State var editing: URL?
var scene: some Scene {
WindowGroup {
ZStack {
if let editing {
RootView(editing: $editing)
} else {
FileBrowserView(editing: $editing,
utType: UTType("com.yourcompany.yourformat")!
pathExtension: "myextension",
newDocumentURL: Bundle.main.url(forResource: "New Document", withExtension: "myextension")!)
}
}
}
}
}
```