我需要将参数传递给runAction:完成回调或访问sprite,它在swift中有这个动作
我有:
sprite.runAction(action, completion: { ... })
我需要像
这样的东西for i in 0..10 {
sprite.runAction(action, completion: {
println(i) // current row, not row at end of cycle (will be 10)
})
}
或:
for i in 0..10 {
var sprite = sprites[i]
sprite.runAction(action, completion: {
println(sprite) // current sprite, not sprite at sprites[10]
})
}