TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2015 |
SPMSupports SPM | ✗ |
Maintained by Lukasz Solniczek.
CQGoogleDirections
is a small set of classes create to simplify use of Google Direction API. CQGoogleDirections
turn respons JSON into set of convenient objects you can use in your application.
To start using CQGoogleDirections
you need only 2 lines of code:
let directionAPI = CQGoogleDirections(from: CLLocationCoordinate2D(latitude: 52.237800, longitude: 21.049662), to: CLLocationCoordinate2D(latitude: 52.226974, longitude: 21.056588), wayPoints: nil)
directionAPI.calculateDirections { response in
switch response.result {
case .Success:
print(response.routes)
case .Failure(_):
print("Error")
}
}
CQRoute
object:CQRoute
is main object which encapsulates information about overviewPolylines
, bounds
and legs
. To access CQRoute
you need to:
case .Success:
if let routes = response.routes as CQRoutes? {
//use routes object
}
Then run the following command from the Terminal:
pod install
Now, from your code, you should be able to simply import the module like this:
import CQGoogleDirections
Lukasz Solniczek, l(dot)solniczek(at)gmail(dot)com
CQGoogleDirections is available under the MIT license. See the LICENSE file for more info.