Skip to content

Commit

Permalink
Replace deprecated API - CLLocationManager.authorizationStatus() (#27)
Browse files Browse the repository at this point in the history
* Calling CLLocationManager.authorizationStatus() is deprecated in iOS 14, tvOS 14, watchOS 7, and macOS 11.
Instead, this has been replaced with a call to the `authorizationStatus` instance variable.

* Fix indentation

* Sets the minimum iOS version back to 13
  • Loading branch information
rhysm94 authored May 30, 2022
1 parent 95d45d7 commit 5e2a5a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/ComposableCoreLocation/Live.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ extension LocationManager {
#endif
return nil
},
authorizationStatus: CLLocationManager.authorizationStatus,
authorizationStatus: {
#if (compiler(>=5.3) && !(os(macOS) || targetEnvironment(macCatalyst))) || compiler(>=5.3.1)
if #available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, macCatalyst 14.0, *) {
return manager.authorizationStatus
}
#endif
return CLLocationManager.authorizationStatus()
},
delegate: { delegate },
dismissHeadingCalibrationDisplay: {
.fireAndForget {
Expand Down

0 comments on commit 5e2a5a0

Please sign in to comment.