Calculating Distance between two coordinates using CLLocation

后端 未结 4 1489
南方客
南方客 2021-01-13 12:03

I\'m using CLLocationDistance to get the distance between two points, but I\'m getting an error when passing my current location in it.

CLLocati         


        
4条回答
  •  误落风尘
    2021-01-13 12:19

    Is swift 2.0 is in the following way:

    let userLocation:CLLocation = CLLocation(latitude: 11.11, longitude: 22.22)
    let priceLocation:CLLocation = CLLocation(latitude: 33.33, longitude: 44.44)
    let meters:CLLocationDistance = userLocation.distanceFromLocation(priceLocation)
    

提交回复
热议问题