Releases: bitkey-oss/sharing-firestore
Releases · bitkey-oss/sharing-firestore
0.4.0
0.3.0
0.2.0
0.1.0
SharingFirestore v0.1.0 Release Notes 🎉
🚀 Release
SharingFirestore is a lightweight wrapper that integrates Firebase Firestore with the Swift Sharing library.
Key Features
- Seamless Firebase Firestore Integration - Combine Firestore's real-time database capabilities with Sharing's powerful observation functions
- Natural SwiftUI Integration - Automatically update UI with
@SharedReaderand@Sharedproperty wrappers - Compatible with
@ObservableModels - Works seamlessly with the latest Swift Observation framework - UIKit Support - Available for use in traditional UIKit applications
- Dynamic Queries - Supports flexible Firestore query construction
- Both Read-only and Sync Modes - Optimize data access with
.queryand.syncstrategies
Usage
// Initialize Firestore
@main
struct MyApp: App {
init() {
prepareDependencies {
FirebaseApp.configure()
$0.defaultFirestore = Firestore.firestore()
}
}
// ...
}
// Example usage in SwiftUI
struct FactsView: View {
@SharedReader(
.query(
configuration: .init(
path: "facts",
predicates: [.order(by: "count", descending: true)],
animation: .default
)
)
)
var facts: IdentifiedArrayOf<Fact>
var body: some View {
List {
ForEach(facts) { fact in
Text(fact.body)
}
}
}
}Installation
Add to your project using Swift Package Manager:
dependencies: [
.package(url: "https://github.com/bitkey-oss/sharing-firestore", from: "0.1.0")
]Documentation
Comprehensive documentation is available at Swift Package Index.
Acknowledgements
This project was inspired by SharingGRDB. We'd like to thank the pointfreeco team for creating such excellent libraries.
Full Changelog: https://github.com/bitkey-oss/sharing-firestore/commits/0.1.0