Jai Singh
Jai Singh

Reputation: 21

nil is not compatible with expected argument type '() -> Void'

SKAction.group([moveToAction, SKAction.fadeAlphaTo(1.0, duration: 0.2)]), completion:nil)

}

runAction(SKAction.waitForDuration(0.2), completion: completion)

When I do this, I get the error:

nil is not compatible with expected argument type '() -> Void'

Upvotes: 2

Views: 4625

Answers (1)

mixel
mixel

Reputation: 25846

() -> Void is not Optional so it can not be nil.

You should pass empty closure as completion parameter:

..., completion: {})

Upvotes: 6

Related Questions