Now that you have a basic understanding of the Swift language, let's take a look at how it is used in Cocos2d.
Creating a Cocos2d-Swift project is very easy. While creating a project, you have to specify the language used as Swift instead of Obj-C while creating a project using SpriteBuilder, as follows:
You will see that the project structure is different now. Instead of the
MainScene.m files, we just have a
Now, to load the
MainScene.swift file, we have to make some changes to the
AppDelegate.m file, just as we did for Obj-C projects.
AppDelegate.m file, ...