Implement CLLocationManagerDelegate methods in Swift

You need to add the NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key to your plist if you haven’t already, they are now mandatory, iOS8+ requires one of these two strings to be set to use locations. Which one you use depends on how you intend ask for the location. Use NSLocationAlwaysUsageDescription for apps that want to use the … Read more

CLLocation Manager in Swift to get Location of User

You are missing two things. First, you have to ask for permission using requestAlwaysAuthorization or requestWhenInUseAuthorization(). So your viewDidLoad() should be like this: var locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestAlwaysAuthorization() locationManager.startUpdatingLocation() } Second, … Read more