【发布时间】:2017-03-06 19:44:10
【问题描述】:
我有一个类的数组。并在 mkmapview 中添加一些注释引脚。
var events = [Events]()
for event in events {
let eventpins = MKPointAnnotation()
eventpins.title = event.eventName
eventpins.coordinate = CLLocationCoordinate2D(latitude: event.eventLat, longitude: event.eventLon)
mapView.addAnnotation(eventpins)
}
使用 map 的委托,我已经实现了一个功能
func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
print(view.annotation?.title! ?? "")
}
如何获取数组events 的哪一行被窃听?
因为我想在另一个 ViewController 中继续,我想发送这个类对象。
【问题讨论】:
标签: ios swift swift3 mkmapview mkannotation