I'm converting a Sprikit App to Swift. But I have a problem to convert this method:
SKAction *releaseBalls = [SKAction sequence:@[[SKAction performSelector:@selector(createMyNode) onTarget:self],[SKAction waitForDuration:1] ]];
Is there any alternative code in Swift ? Thanks
Try this out
class MyScene: SKScene {
func doAction() {
let releaseBalls = SKAction.sequence([
SKAction.runBlock(self.createMyNode),
SKAction.waitForDuration(1)
])
// run action
}
func createMyNode() {
// create the nodes
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With