我正在从我的应用程序启动 iOS 地图,但显示“未知位置”。
以下是将标题添加到位置的方法:
@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])
}
你们中的任何人都知道我在做什么错吗?或者为什么不取名字的价值?
我会非常感谢你的帮助。