Getting an error about asking for location permission: "Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first." The problem is I already did and it was working fine earlier until I added a url scheme for something completely different.
This is in my ViewController:
override func viewDidLoad()
{
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.locationManager.delegate = self
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
self.locationManager.requestAlwaysAuthorization()
self.locationManager.startUpdatingLocation()
self.mapView.showsUserLocation = true
//your loc
mapView.delegate = self
let initialLocation = CLLocation(latitude: 39, longitude: 77)
centerMapOnLocation(initialLocation)
}