MKMapItem not updating name value

117 Views Asked by At

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])
    }

MKMapItem 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.

0

There are 0 best solutions below