Is there a way to spread a tuple into the arguments of a function?

Correct, it used to be called a tuple splat. RIP.

https://www.hackingwithswift.com/swift/2.2/tuple-splat

I wish we had something like the following:

func myFunction(one: Int, two: Int, three: Int) {}

var tuple = (1,2,3)

myFunction.invoke(with: tuple)

Maybe one day.

1 Like