Swiftpack.co - AsyncSwift/AsyncLocationKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AsyncSwift.
AsyncSwift/AsyncLocationKit 1.5.6
📍async/await CoreLocation
⭐️ 76
🕓 3 weeks ago
iOS macOS
.package(url: "https://github.com/AsyncSwift/AsyncLocationKit.git", from: "1.5.6")


Swift Package Manager Swift Platforms

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


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


pod 'AsyncLocationKit', :git => 'https://github.com/AsyncSwift/AsyncLocationKit.git', :tag => '1.5.5'

:warning: Initialize AsyncLocationManager only synchronously on MainThread

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: 

If Task was canceled, Stream finished automaticaly.


Stars: 76
Last commit: 4 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

3 weeks ago

Removed all warnings 🙂

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics