Alternative method for performSelector in SKAction in Swift

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

Answers


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
    }
}

Need Your Help

How to close admob inersitial after click on it

android admob interstitial

I use AdMob Interstitials in my Android app in a simple way, just something like in example from

Android Support Library 22.1 and AlertDialog bug?

android appcompat material-design appcompat-v7-r22.1

I tried to update my AlterDialog to the new android.support.v7.app.AlertDialog, just changing the:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.