ForgeObservers
Reactive system observers for iOS.
Protocol-oriented. AsyncStream-powered. Thread-safe.
.package(url: "...ForgeObservers", from: "1.0.0") Quick Example
import ForgeObservers
@Observable
final class NetworkViewModel {
private let connectivity: ConnectivityObserving
var isOffline = false
var isOnWifi = false
init(connectivity: ConnectivityObserving) {
self.connectivity = connectivity
}
func startObserving() async {
for await status in connectivity.statusStream {
isOffline = !status.isConnected
isOnWifi = status.interface == .wifi
}
}
} Why ForgeObservers
Protocol-Oriented
Every observer has a protocol. Depend on abstractions, swap implementations in tests.
AsyncStream
All observers expose reactive AsyncStreams. Subscribe and get updates as they happen.
Thread Safe
Every observer is internally synchronized. Read state from any thread, any queue.
Forge Ecosystem
ForgeInject
Lightweight dependency injection for iOS. Property wrapper. Thread-safe.
ForgeObservers
currentReactive system observers. Connectivity, lifecycle, keyboard, and more.
ForgeStorage
Type-safe persistence. Key-value, file storage, and Keychain.
ForgeBackgroundTasks
BGTaskScheduler registration, scheduling, and dispatch for iOS.
ForgeLocation
Location-based triggers. Geofencing, significant changes, and visits.
ForgePush
Push notification management. Permissions, tokens, and routing.
ForgeOrchestrator
Sequence, pipeline, and monitor orchestrators for iOS app flows.