Skip to content

Commit 920d9dc

Browse files
committed
Update Permission.swift
1 parent 1c0a066 commit 920d9dc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/d3-async-location/Permission.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class Permission{
2222
private var status : CLAuthorizationStatus
2323

2424
/// Continuation to get permission if status is not defined
25-
private var permissioning : CheckedContinuation<CLAuthorizationStatus, Never>?
25+
private var flow : CheckedContinuation<CLAuthorizationStatus, Never>?
2626

2727
/// Check if status is determined
2828
private var isDetermined : Bool{ status != .notDetermined }
@@ -50,19 +50,19 @@ final class Permission{
5050

5151
/// Subscribe for event when location manager change authorization status to go on access permission flow
5252
private func initSubscription(){
53-
cancelable = NotificationCenter.default.publisher(for: Permission.authorizationStatus, object: nil)
53+
let name = Permission.authorizationStatus
54+
cancelable = NotificationCenter.default.publisher(for: name)
5455
.sink { [weak self] value in
55-
self?.authorizationChanged(value)
56+
self?.statusChanged(value)
5657
}
5758
}
5859

5960
/// Determine status after the request permission
6061
/// - Parameter manager: Location manager
61-
private func authorizationChanged(_ value: Output) {
62+
private func statusChanged(_ value: Output) {
6263
if let s = value.object as? CLAuthorizationStatus{
6364
status = s
64-
permissioning?.resume(returning: status)
65-
print(status, "authorizationStatus")
65+
flow?.resume(returning: status)
6666
}
6767
}
6868

@@ -84,7 +84,7 @@ final class Permission{
8484
}
8585

8686
return await withCheckedContinuation{ continuation in
87-
permissioning = continuation
87+
flow = continuation
8888
}
8989
}
9090
}

0 commit comments

Comments
 (0)