I'm new to swift and I haven't programmed much at all lately. I'm trying to assign an array from an array of arrays to a variable. But as far as I can tell, i only get a copy of that array (so that if the member of the array of arrays later changes, the copy doesn't. How do I get a reference to the original object?
Here is some code (included before "class ViewController: UIViewController" in an effort to get global variables):
var g1 = [2,0,0,0,0]
var g2 = [2,0,0,0,0]
var g3 = [2,0,0,0,0]
var g4 = [3,0,0,0,0]
var g5 = [3,0,0,0,0]
var g6 = [4,0,0,0,0]
var g7 = [5,0,0,0,0]
let groids: Array = [g1, g2, g3, g4, g5, g6, g7]
Later, as part of some function, I want to assign a variable "a" one of the members of groids, but as I stated not a copy of that member but that member itself. How do I do this? Please bear in mind that I have little programming experience.