问题
At the beggining of this post I would like thank @Nirav D for help :)
Ok. So the problem.
There is a class i want to pass with prepareForSegue func with google marker. How to do it?
回答1:
You are too close to pass simply set the passedMarker with your array object.
if let marker = sender as? GMSMarker , //is it correct do declare marker as GMSMarker?
let dict = marker.userData as? [String:Int] {
let markerIndex = dict["index"]!
nextVC.passedMarker = self.markers[markerIndex]
}
Now simply access passedMarker property in viewDidLoad of VC3.
回答2:
Edit this performSegue(withIdentifier: "details", sender: marker)
To performSegue(withIdentifier: "details", sender: self)
来源:https://stackoverflow.com/questions/42876232/passing-data-from-marker-to-other-vc