user2924482
user2924482

Reputation: 9140

MKMapItem not updating name value

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.

Upvotes: 1

Views: 127

Answers (0)

Related Questions