I am trying to pass an Array Object between 2 view controllers. But I want the Array to be passed as a Reference and not copied. I know if I was using a function locally, I can use "inout" and "&" based on the examples I found.
But I what I want to do is slightly different. I want to assign the Array in VC1 directly to the Array object in VC2 as a reference. Here is my code:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "vc2" {
let vc2 = segue.destinationViewController as! ProfileVC
vc2.data = &self.data //I know this line doesn't work, how would I go about it?
}
}