title: Swift CLLocation does not update location at startup
body: <p>I have an application were I want to get the users location in viewDidLoad, I then store the lat and long in variables and use them in a function to get data based on the position from the user. I have a timer that calls a function every x minute that gets data (let´s call it getData()), the first time getData() is called lat and long is 0, but the second, third time etc.. they have values.</p>
  
  <p>When I update the coords (during runtime) in the simulator I do get the updated values for both lat and long, but it´s the first run that lat and long always are 0. My code looks like this:</p>
  
  <pre><code>let locationManager = CLLocationManager()
  var getDataGroup = dispatch_group_create()
  
  override func viewDidLoad() {
          super.viewDidLoad()
  
          dispatch_group_enter(getDataGroup)
          self.locationManager.delegate = self
          self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
          self.locationManager.requestWhenInUseAuthorization()
          self.locationManager.startUpdatingLocation()
          dispatch_group_leave(getDataGroup)
  
          dispatch_group_wait(getDataGroup, DISPATCH_TIME_FOREVER)
  
          dispatch_async(dispatch_get_main_queue()) {
               self.getData()
          }
  
      }
  
  func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
          CLGeocoder().reverseGeocodeLocation(manager.location, completionHandler: { (placemarks, error) -&gt; Void in
              if (error != nil){
                  println("Error: " + error.localizedDescription)
                  return
              }
              if (placemarks.count &gt; 0){
                  let pm = placemarks[0] as! CLPlacemark
                  self.displayLocationInfo(pm)
              }
              else{
                  println("Error with location data")
              }
          })
      }
  
      func displayLocationInfo (placemark : CLPlacemark){
          self.locationManager.stopUpdatingLocation()
          lat = String(stringInterpolationSegment: placemark.location.coordinate.latitude)
          long = String(stringInterpolationSegment: placemark.location.coordinate.longitude)
      }
  
      func locationManager(manager: CLLocationManager!, didFailWithError error: NSError!) {
          println("Error: " + error.localizedDescription)
      }
  
  func getData(){
       // Do stuff with lat and long...
  }
  </code></pre>
  
  <p>For some reason the first run lat and long are both 0, the rest of the runs they have a valid value. The problem is that getData is called before the locationManager and displayLocationInfo methods even though I have added self.locationManager.startUpdatingLocation() before the call to getData() for some reason.</p>