Skip to content

Commit eea32fb

Browse files
authored
Merge pull request #19 from AsyncSwift/development
Check permission method
2 parents 2d12472 + 565e305 commit eea32fb

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

AsyncLocationKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'AsyncLocationKit'
33
s.module_name = 'AsyncLocationKit'
4-
s.version = '1.5.2'
4+
s.version = '1.5.3'
55
s.summary = '📍async/await CoreLocation'
66
s.homepage = 'https://github.com/AsyncSwift/AsyncLocationKit'
77
s.license = 'MIT'

Sources/AsyncLocationKit/AsyncLocationKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
import Foundation
2424

25-
public let version: String = "1.0.5"
25+
public let version: String = "1.5.3"

Sources/AsyncLocationKit/AsyncLocationManager.swift

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public final class AsyncLocationManager {
5050
self.desiredAccuracy = desiredAccuracy
5151
}
5252

53+
public func checkingPermissions() -> CLAuthorizationStatus {
54+
if #available(iOS 14, *) {
55+
return locationManager.authorizationStatus
56+
} else {
57+
return CLLocationManager.authorizationStatus()
58+
}
59+
}
60+
5361
public func updateAccuracy(with newAccuracy: LocationAccuracy) {
5462
locationManager.desiredAccuracy = newAccuracy.convertingAccuracy
5563
}
@@ -195,14 +203,3 @@ public final class AsyncLocationManager {
195203
locationManager.stopRangingBeacons(satisfying: satisfying)
196204
}
197205
}
198-
199-
extension AsyncLocationManager {
200-
/// Check if user already allowed location permission
201-
private func checkingPermissions() -> CLAuthorizationStatus {
202-
if #available(iOS 14, *) {
203-
return locationManager.authorizationStatus
204-
} else {
205-
return CLLocationManager.authorizationStatus()
206-
}
207-
}
208-
}

0 commit comments

Comments
 (0)