title: swift - Using Delegate Method's Return Value to Set Variable
body: <p>To give you a basic idea of what I want to accomplish, I would like to have a map that zooms in to the user's current location and then follows the user at that zoom level.</p>
  
  <p>In view_did_load I have:</p>
  
  <pre><code>    let span = MKCoordinateSpanMake(0.075, 0.075)
      let region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: currentLat, longitude: currentLong), span: span)
      map.setRegion(region, animated: true)
  </code></pre>
  
  <p>Below that I have a delegate function for my location manager:</p>
  
  <pre><code>func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) -&gt; (lat: CLLocationDegrees, long: CLLocationDegrees) {
      let userLocation:CLLocation = locations[0]
      let currentLong = userLocation.coordinate.longitude
      let currentLat = userLocation.coordinate.latitude
      return (currentLat, currentLong)
  }
  </code></pre>
  
  <p>Is it possible to use the return value from this delegate method to set the latitude and longitude where I declare my region variable? Currently when I try this it says "Constant 'currentLat' used before being initialized" and "Constant 'currentLong' used before being initialized." My approach might be completely different from the solution, but thank you for any help you can offer!</p>