Group Group Group Group Group Group Group Group Group

Chapter 22:Get Location Data

let authStatus = CLLocationManager.authorizationStatus()
if  authStatus == .notDetermined {
  locationManager.requestWhenInUseAuthorization()
  return
}

Error: if authStatus == .notDetermined {:Expected declaration

Hi @herbay, with an error such as expected declaration there is a chance your code is not placed in the proper spot. Make sure your if statement is not outside of a function or viewDidLoad.

Best,
Gina