Reputation: 528
I have a ground object being repeated 23 times:
var moveGroundSpritesForever = SKAction.repeatAction(SKAction.sequence([moveGroundSprite]), count: 23)
How can I create an if statement in swift for when this count finishes to perform another action? Thanks
Upvotes: 1
Views: 813
Reputation: 3991
Use func runAction(action: SKAction!, completion block: (() -> Void)!)
. completion
closure will trigger when all your repeated actions are executed
Upvotes: 1