When I click the button my app shows a map: it opens the google map perfectly in the browser safari.
Now I just want to show the map into a UIWebView
.
Here is the code I use to show the map:
@IBAction func newAction(sender: UIBarButtonItem) {
if (UIApplication.sharedApplication().canOpenURL(NSURL(string:"comgooglemaps://")!)) {
UIApplication.sharedApplication().openURL(NSURL(string:
"http://maps.google.com/maps?daddr=" + self.longitud + "," + self.latitud + "&saddr=" + self.lat1 + "," + self.long1 + "&views=traffic")!)
} else {
mostrarAlerta("Por favor descarga e instala google map desde el AppleStore")
}
}
Just display UIWebView on the IBAction? You're going to want something like this: