Reputation: 9140
I'm launching the iOS maps from my app but is showing "Unknown Locations".
Here is how adding the title to the location:
@IBAction func directionsToLocation(_ sender: Any) {
let destionationMapItem = MKMapItem(placemark: MKPlacemark(coordinate: self.annotation.coordinate))
destionationMapItem.name = "Destionation"
let startLocation = MKMapItem(placemark: MKPlacemark(coordinate: self.currectLocation))
startLocation.name = "My current Location"
MKMapItem.openMaps(with: [destionationMapItem,startLocation], launchOptions: [MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeTransit])
}
Any of you knows what I'm doing wrong? or why is not taking the value of the name?
I'll really appreciate your help.
Upvotes: 1
Views: 127