File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -42,4 +42,19 @@ extension LocationService : CLLocationManagerDelegate {
42
42
delegate? . locationDidFail ( withError: swError)
43
43
print ( " Error finding location: \( error. localizedDescription) " )
44
44
}
45
+
46
+ // requestWhenInUseAuthorization issue #70
47
+ // Handle Authorization Status Changes
48
+ func locationManager( _ manager: CLLocationManager , didChangeAuthorization status: CLAuthorizationStatus ) {
49
+ if status == . authorizedWhenInUse {
50
+ locationManager. requestLocation ( )
51
+ }
52
+ }
53
+
54
+ @available ( iOS 14 . 0 , * )
55
+ func locationManagerDidChangeAuthorization( _ manager: CLLocationManager ) {
56
+ if manager. authorizationStatus == . authorizedWhenInUse{
57
+ locationManager. requestLocation ( )
58
+ }
59
+ }
45
60
}
You can’t perform that action at this time.
0 commit comments