title: Swift - Trying to get current location
body: <p>I am trying to get the long and lat of my users locations, I have done the following:</p>
  
  <p>imported Core Location</p>
  
  <pre><code>import CoreLocation
  </code></pre>
  
  <p>Add Core Location Delegate</p>
  
  <pre><code>class ViewController: UIViewController, CLLocationManagerDelegate, AVCaptureMetadataOutputObjectsDelegate, DTDeviceDelegate {
  </code></pre>
  
  <p>defined this variable:</p>
  
  <pre><code>var locationManager: CLLocationManager!
  </code></pre>
  
  <p>and then added this method:</p>
  
  <pre><code>func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
          let userLocation:CLLocation = locations[0] 
          let long = userLocation.coordinate.longitude;
          let lat = userLocation.coordinate.latitude;
  
          print(long, lat)
  
          //Do What ever you want with it
      }
  </code></pre>
  
  <p>but the location does not get printed, my method does not even get it.</p>
  
  <p>I add the items to use Core Location to my plist and the app ask me to use the location services when I first run it. But now location is getting printed....what am I doing wrong?</p>