Sagaya Abdul Sagaya Abdul -4 years ago 296
iOS Question

Google distance api with ios swift

I want to use the google distance api to calculate the distance in kilometers with iOS swift have tried going through the distance matrix api but seems there is no sdk for ios

Answer Source

You could use distanceFromLocation method.

let distanceInMeters = location1.distanceFromLocation(location2)

Your location1 and location2 are CLLocation instances .

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download