open google maps and show direction from one place to another iOS swift.
Solution:
I had a button in my app.I want to open google maps and navigation to that location from my current location when the user clicks.
I had a button in my app.I want to open google maps and navigation to that location from my current location when the user clicks.
if (UIApplication.shared.canOpenURL(URL(string:"comgooglemaps://")!)){
UIApplication.shared.openURL(NSURL(string:
"comgooglemaps://?saddr=&daddr=\(lat),\(long)&directionsmode=driving")! as URL)
} else{
NSLog("Can't open com.google.maps://");
}
Comments
Post a Comment