I\'m trying to create an array of tuples in Swift, but having great difficulty:
var fun: (num1: Int, num2: Int)[] = (num1: Int, num2: Int)[]()
This also works:
var fun:Array<(Int,Int)> = []
fun += (1,2)
fun += (3,4)
Oddly though, append wants just one set of parens:
fun.append(5,6)
If you want the labels for the tuple parts:
var fun:Array<(num1: Int, num2: Int)> = []
fun += (1,2) // This still works
fun.append(3,4) // This does not work
fun.append(num1: 3, num2: 4) // but this does work