SKAction.customActionWithDuration 一行中的连续语句必须用';'分隔

SKAction.customActionWithDuration Consecutive statements on a line must be separated by ';'

我尝试下一个代码但出现以下错误:"Consecutive statements on a line must be separated by ';'"。我哪里错了?

let moveLeft = SKAction.customActionWithDuration(0.0, actionBlock: {node: SKNode!, elapsedTime: CGFloat) -> Void in
            node.physicsBody?.velocity = CGVectorMake(0.5, 0.5)
          })

闭包中的参数就像一个元组,两边都需要括号。此外,您还应该显式展开节点的 physicsBody(如果它可能为 nil,则使用 if let)。

let moveLeft = SKAction.customActionWithDuration(0.0, actionBlock: { (node: SKNode!, elapsedTime: CGFloat) -> Void in
    node.physicsBody!.velocity=CGVector(dx: 0.5, dy: 0.5)
})