title: How to calculate the distance between my current location and other Pins in MapView
body: <p>I am new to Swift and I need to calculate the nearest places around my current location. Would you advice me which function should I use to calculate the distance between my location and the nearest around me. I have to display the distance and the places in the app,so that the user can choose which one fits best for him.I think I should use latitude and longitude coordinates which can be compared with mine. I also found out that I have to use distanceFromLocation , but I do not know how and I would be glad if someone provide me with an example which I can use for my code.
  My code so far is:</p>
  
  <pre><code> class ViewThree: UIViewController, CLLocationManagerDelegate{
  @IBOutlet weak var SegmentControl: UISegmentedControl!
  @IBOutlet weak var Mapview: MKMapView!
  
  
  var manager =  CLLocationManager()
  var receiveImeNaSladkarnica: String = ""
  var KordaA: String = ""
  var KordaB: String = ""
  var PodImeNaObekt: String = ""
  
    override func viewDidLoad() {
  super.viewDidLoad()
  
  
      let pinLocation: CLLocationCoordinate2D = CLLocationCoordinate2DMake((KordaA as NSString).doubleValue,(KordaB as NSString).doubleValue)
      let objectAnn = MKPointAnnotation()
      objectAnn.coordinate = pinLocation
      objectAnn.title = receiveImeNaSladkarnica
      objectAnn.subtitle = PodImeNaObekt
      self.Mapview.addAnnotation(objectAnn)
  
   }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
  }
  
  @IBAction func Directions(sender: AnyObject) {
      UIApplication.sharedApplication().openURL(NSURL(string: "http://maps.apple.com/maps?daddr=\((KordaA as NSString).doubleValue),\((KordaB as NSString).doubleValue))")!)
  
  
  
  }
  
  @IBAction func MapType(sender: AnyObject) {
      if (SegmentControl.selectedSegmentIndex == 0){
          Mapview.mapType = MKMapType.Standard
      }
      if (SegmentControl.selectedSegmentIndex == 1){
          Mapview.mapType = MKMapType.Satellite
      }
  
  
  }
  
  @IBAction func LocateMe(sender: AnyObject) {
      manager.delegate = self
      manager.desiredAccuracy = kCLLocationAccuracyBest
      manager.requestWhenInUseAuthorization()
      manager.startUpdatingLocation()
  
      Mapview.showsUserLocation = true
  
  
  
  }
  func  locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
      let userlocation: CLLocation = locations[0] as CLLocation
      manager.stopUpdatingLocation()
      let location = CLLocationCoordinate2D(latitude: userlocation.coordinate.latitude, longitude: userlocation.coordinate.longitude)
      let span = MKCoordinateSpanMake(0.5, 0.5)
      let region = MKCoordinateRegion(center: location, span: span)
      Mapview.setRegion(region, animated: true )
  }
  </code></pre>