We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7349a50 commit e8356ffCopy full SHA for e8356ff
.DS_Store
8 KB
SwiftWeather/LocationService.swift
@@ -42,4 +42,19 @@ extension LocationService : CLLocationManagerDelegate {
42
delegate?.locationDidFail(withError: swError)
43
print("Error finding location: \(error.localizedDescription)")
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
58
59
60
0 commit comments