0
我在我的地图上有注释。我想在用户点击AccessoryControl并将数据传递给视图控制器时打开一个新的视图控制器。将数据传递给MapDetailViewController
所以我这样做:
func mapView(mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {
self.performSegueWithIdentifier("Details", sender: view)
}
则:
if segue.identifier == "Details" {
let placeDetailViewController = segue.destinationViewController as! PlaceDetailViewController
let place: Place = places[?index?]
placeDetailViewController.place = place
}
所以我想我的注释的指标,不知道如何做到这一点。
帮助。谢谢。
不是字符串,但整个物体 – aaisataev
你可以注解为您的**发件人属性**(_view_您的例子)和将其设置为** vc.annotation = sender.annotation **。或者创建任何其他财产 –