CLLocation distanceFromLocation(在Swift?中)

Pro*_*eus 7 cllocation cllocationdistance swift

有人可以帮我将以下Objective-C语句转换为Swift吗?

CLLocationDistance distance = [fromLocation distanceFromLocation:toLocation];
Run Code Online (Sandbox Code Playgroud)

我知道这样做一定很简单.我是iOS编程的全新,任何帮助将不胜感激.

谢谢!:-)

Mun*_*ndi 20

let distance = fromLocation.distanceFromLocation(toLocation)
Run Code Online (Sandbox Code Playgroud)

新语法:

let distance = aLocation.distance(from: anotherLocation)
Run Code Online (Sandbox Code Playgroud)