@@ -11,13 +11,13 @@ Wrapper for Apple `CoreLocation` framework with new Concurency Model. No more `d
11
11
##### SPM
12
12
``` swift
13
13
dependencies: [
14
- .package (url : " https://github.com/AsyncSwift/AsyncLocationKit.git" , .upToNextMinor (from : " 1.6.3 " ))
14
+ .package (url : " https://github.com/AsyncSwift/AsyncLocationKit.git" , .upToNextMinor (from : " 1.6.4 " ))
15
15
]
16
16
```
17
17
18
18
#### Cocoapods
19
19
```
20
- pod 'AsyncLocationKit', :git => 'https://github.com/AsyncSwift/AsyncLocationKit.git', :tag => '1.6.3 '
20
+ pod 'AsyncLocationKit', :git => 'https://github.com/AsyncSwift/AsyncLocationKit.git', :tag => '1.6.4 '
21
21
```
22
22
23
23
@@ -28,32 +28,26 @@ import AsyncLocationKit
28
28
29
29
let asyncLocationManager = AsyncLocationManager (desiredAccuracy : .bestAccuracy )
30
30
31
- Task {
32
- let permission = await self .asyncLocationManager .requestAuthorizationWhenInUse () // returns CLAuthorizationStatus
33
- }
31
+ let permission = await self .asyncLocationManager .requestAuthorizationWhenInUse () // returns CLAuthorizationStatus
34
32
```
35
33
36
34
You can use all methods from Apple ` CLLocationManager ` .
37
35
38
36
``` swift
39
- Task {
40
- let coordinate = try await asyncLocationManager.requestLocation () // Request user location once
41
- }
37
+ let coordinate = try await asyncLocationManager.requestLocation () // Request user location once
42
38
```
43
39
44
40
Start monitoring update of user location with ` AsyncStream ` .
45
41
46
42
``` swift
47
- Task {
48
- for await locationUpdateEvent in await asyncLocationManager.startUpdatingLocation () {
49
- switch locationUpdateEvent {
50
- case .didUpdateLocations (let locations):
51
- // do something
52
- case .didFailWith (let error):
53
- // do something
54
- case .didPaused , .didResume :
55
- break
56
- }
43
+ for await locationUpdateEvent in await asyncLocationManager.startUpdatingLocation () {
44
+ switch locationUpdateEvent {
45
+ case .didUpdateLocations (let locations):
46
+ // do something
47
+ case .didFailWith (let error):
48
+ // do something
49
+ case .didPaused , .didResume :
50
+ break
57
51
}
58
52
}
59
53
```
0 commit comments