Confused
Confused

Reputation: 6288

Run completion: after sequence or group of SKActions

I'm unable to figure out what I'm doing wrong in the following syntax, to get a completion to run.

  spriteWhite.run(SKAction.group([moveRight, swipeRight],
       completion: {self.doThisFunction(withThisValue)}))

The error is:

Extra argument "completion" in call.

Upvotes: 1

Views: 670

Answers (1)

Alessandro Ornano
Alessandro Ornano

Reputation: 35412

Try to change:

spriteWhite.run(SKAction.group([moveRight, swipeRight],
           completion: {self.doThisFunction(withThisValue)}))

with:

spriteWhite.run(SKAction.group([moveRight, swipeRight]),
       completion: { self.doThisFunction(withThisValue) })

The issue is due to a syntax error: the parenthesis after the second square brackets to close SKAction definition.

Upvotes: 2

Related Questions