DocumentKit
DocumentKit copied to clipboard
DocumentKit is a Swift SDK that adds more capabilities to DocumentGroup-based apps in SwiftUI.
About DocumentKit
DocumentKit is an SDK that adds more capabilities to DocumentGroup-based SwiftUI apps.
DocumentGroup-based apps are in general quite limited when it comes to customization. For instance, you can't add custom items to the document browser toolbar.
Also, since a DocumentGroup has no view until you open a document, you can't present any initial onboarding screens or modals from it.
DocumentKit makes it easy to do all these things, to let you create a better user experience for your document-based apps.
Installation
DocumentKit can be installed with the Swift Package Manager:
https://github.com/danielsaidi/DocumentKit.git
Getting started
DocumentKit extends DocumentGroup with modifiers that let you add custom toolbar items, customize the document browser etc.:
@main
struct MyApp: App {
var body: some Scene {
DocumentGroup(newDocument: DemoDocument()) { file in
ContentView(document: file.$document)
}
.additionalNavigationBarButtonItems(
leading: [...],
trailing: [...]
)
.allowsDocumentCreation(true)
.allowsPickingMultipleItems(true)
.showFileExtensions(true)
.onboardingSheet {
MyOnboardingScreen()
}
.splashSheet {
MySplashScreen()
}
}
}
DocumentKit also extends DocumentGroup with modifiers that let you present onboarding modals and splash screens when the app launches, lets you inspect the underlying document browser, etc.
For more information, please see the getting started guide.
Documentation
The online documentation has more information, articles, code examples, etc.
Demo Application
The demo app lets you explore the library with iOS. To try it out, just open and run the Demo project.
Support my work
You can sponsor me on GitHub Sponsors or reach out for paid support, to help support my open-source projects.
Your support makes it possible for me to put more work into these projects and make them the best they can be.
Contact
Feel free to reach out if you have questions or if you want to contribute in any way:
- Website: danielsaidi.com
- Mastodon: @[email protected]
- Twitter: @danielsaidi
- E-mail: [email protected]
License
DocumentKit is available under the MIT license. See the LICENSE file for more info.