In Swift, structs and value types are passed by value by default, just like in C#. But C# also has a very usable ref keyword, that forces the parameter to be passed by refer
Use the inout qualifier for a function parameter.
inout
func swapTwoInts(a: inout Int, b: inout Int) { let temporaryA = a a = b b = temporaryA } swapTwoInts(&someInt, &anotherInt)
See Function Parameters and Return Values in the docs.