I have a Objective-C function which we'll call foo for the purposes of being useful to others.
something a //Define variable a as a 'something' type
[foo:&a]
How do I go about translating this into swift?
In swift if you want to pass by reference you use the inout notation in your function definition
such as
func test(inout a : Double) {
//do something
}
var d : Double = 3.5
test(&d)
If you are referring to using a function directly you would use the same &variable notation you use elsewhere
So you would just call foo(&var)
something? A scalar type, struct, union, class, ...? What doesfoo? How is the method declared? Does it modify the referenced element? – A concrete compiling example would be helpful.