import CoreLocation
class VC: ... {
...
let locationManager = CLLocationManager()
func viewDidLoad() {
...
locationManager.requestWhenInUseAuthorization()
}
}
use location manager to request location!
requestLocation()
startUpdatingLocation()
...moniter. ..cl
2021-09-03 19:45:23.262967+0900
Clima[25555:1531511] *** Terminating app due to uncaught exception
'NSInternalInconsistencyException',
reason: 'Delegate must respond to locationManager:didUpdateLocations:'
//MARK: - CLLocationManagerDelegate
extension WeatherViewController: CLLocationManagerDelegate {
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
print("call the locationManager")
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
print(error)
}
}
location check in simulator?
simul ⇒ feature ⇒ location ⇒ custom or bicycle or car or run ..
//locationManager.stopUpdatingLocation()
what's mean?