$ show AsyncSwift/AsyncLocationKit
AsyncLocationKit is a pure Swift library that provides a modern async/await interface for Apple's CoreLocation framework. It eliminates the traditional delegate pattern by using a 'Performer' architecture where individual handlers (performers) process specific CoreLocation delegate callbacks and communicate results via Swift concurrency primitives like CheckedContinuation (for one-shot requests) and AsyncStream (for continuous monitoring). The library supports all major CoreLocation features: single location requests, continuous updates, region monitoring, visit monitoring, heading updates, beacon ranging, significant location changes, and authorization handling. It is thread-safe, uses zero external dependencies, and supports iOS, macOS, watchOS, and tvOS. The code is well-structured with clear separation of concerns, but the internal performer pattern is tightly coupled to CoreLocation event types, limiting direct extractability. Overall, it is a polished, production-ready wrapper that demonstrates strong Swift concurrency practices.
The LLM identified 1 files worth highlighting for reuse:
A self-contained utility that monitors application lifecycle state transitions (resign active, become active) using Swift's AsyncSequence from NotificationCenter. It encapsulates cross-platform notification name handling and provides a clean async API to check if the app has resigned or become active. This component is fully decoupled from CoreLocation and could be extracted as a standalone `AppStateMonitor` module for any Apple platform project. It demonstrates skillful use of `AsyncMapSequence` and `@MainActor` isolation for safe state tracking.