In build phases, add the location framework.
So the first thing you need to do is to add one or both of the following keys to your Info.plist file:
In the app delegate,
import CoreLocation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var locationManager: CLLocationManager! = CLLocationManager()
locationManager.requestAlwaysAuthorization()
locationManager.startUpdatingLocation()
func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
var location = locations[0] as CLLocation
println(location)
}