Popularity
1.0
Growing
Activity
6.6
Declining
35
2
5

Programming language: Swift
License: MIT License
Tags: Location    

AsyncLocationKit alternatives and similar libraries

Based on the "Location" category.
Alternatively, view AsyncLocationKit alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of AsyncLocationKit or a related project?

Add another 'Location' Library

README

AsyncLocationKit

Swift Package Manager Swift Platforms

Wrapper for Apple CoreLocation framework with new Concurency Model. No more delegate pattern or completion blocks.

Install

dependencies: [
    .package(url: "https://github.com/AsyncSwift/AsyncLocationKit.git", .upToNextMinor(from: "1.5.0"))
]
import AsyncLocationKit

let asyncLocationManager = AsyncLocationManager(desiredAccuracy: .bestAccuracy)

Task {
    let permission = await self.asyncLocationManager.requestAuthorizationWhenInUse() //returns CLAuthorizationStatus
}

You can use all methods from Apple CLLocationManager.

Task {
    let coordinate = try await asyncLocationManager.requestLocation() //Request user location once
}

Start monitoring update of user location with AsyncStream.

Task {
    for await locationUpdateEvent in await asyncLocationManager.startUpdatingLocation() {
        switch locationUpdateEvent {
        case .didUpdateLocations(let locations):
            // do something
        case .didFailWith(let error):
            // do something
        case .didPaused, .didResume: 
            break
        }
    }
}

If Task was canceled, Stream finished automaticaly.