var test = [(face: SKNode, body: SKNode)]()
不起作用。如何声明一个名为元组的空数组?
答案 0 :(得分:5)
您可以随时使用typealias
typealias MyTupleThing = (face: SKNode, body: SKNode)
var test = [MyTupleThing]()
答案 1 :(得分:3)
尝试:
var test: [(face: SKNode, body: SKNode)] = []
或
var test = Array<(face: SKNode, body: SKNode)>()