Check this:
Click on project targets / create phases / Link binaries to libraries /
This file must be listed: CoreLocation.framework if there is not click Add and select it from the list.
In your ViewController.swift check this:
import CoreLocation
ViewController class: UIViewController, CLLocationManagerDelegate {
/ Supporting files /info.plist <- Click on this file
Press + to add: Key: NSLocationAlwaysUsageDescription Type: String Value: Add description
Press + to add: Key: NSLocationWhenInUseUsageDescription Type: String Value: Add description
check iOS Simulator / Debug / Location / Apple here you should select something (none => error)
Ajochope
source share