Sagaya Abdul Sagaya Abdul - 3 months ago 63
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

You could use distanceFromLocation method.

let distanceInMeters = location1.distanceFromLocation(location2)

Your location1 and location2 are CLLocation instances .

Comments