In C++ you can do
int x = 5;
int &y = x;
So both x
and y
point to the same place. Can I do this in Swift?
I'm programming a class with some functionality, and another class which is basically a driver.
class Driver {
var otherClass: OtherClass
var referenceVariable: Int = otherClass.referenceVariable // how to make a reference here
...
}
Or is there a better / more semantically correct way to do this in Swift?