Slide 17
Slide 17 text
ͬͪ·࣮ͬͨ
(.notDeterminedΛϋϯυϦϯά͍ͯ͠ͳ͍ύλʔϯ)
override func viewDidLoad() {
super.viewDidLoad()
self.lm.delegate = self
self.lm.requestAlwaysAuthorization()
}
func locationManager(_ manager: CLLocationManager, didChangeAuthorization
status: CLAuthorizationStatus) {
switch status {
case .authorizedAlways, .authorizedWhenInUse:
manager.startUpdatingLocation()
default: break
}
}