Skip to content

Async location streamer using new concurrency model in Swift

Latest
Compare
Choose a tag to compare
@swiftuiux swiftuiux released this 03 Dec 14:32
· 3 commits to main since this release
7e40816

Release notes Version 2.1.0

  1. Pre-configured CLLocationManager Support

    • Pass a pre-configured CLLocationManager instance to LocationManagerAsync for complete control over the location manager's settings.
  2. Asynchronous Location Streaming

    • Stream location updates asynchronously using AsyncStream for efficient real-time data handling.
  3. Customizable Update Strategies

    • Choose how location results are retained with the Strategy enum:
      • .keepLast: Retains only the latest location update.
      • .keepAll: Retains all location updates during the session.
  4. Permission Management

    • Automatically handles permission requests for location updates, ensuring smooth user experience.
    • Detects and handles denied or restricted permissions with error reporting.
  5. Background Location Support

    • Enables continuous location updates in the background when configured with allowsBackgroundLocationUpdates.
  6. Stream State Management

    • Tracks the current state of location streaming (idle or streaming).
    • Supports starting, stopping, and restarting streams with ease.
  7. Seamless Integration with SwiftUI

    • Inject LocationStreamer into SwiftUI views using @EnvironmentObject for declarative UI updates.
  8. Custom Initialization Options

    • Flexible initialization with parameters for accuracy, activity type, distance filter, and background updates.
  9. Error Handling

    • Provides descriptive error types, including CLError and custom errors for denied permissions or invalid configurations.