I am quite new to swift and I have constructed a main menu in the main.storyboard file, how do I assign the 'Play Now' button to launch the GameViewController.swift file where I actually plan to program the game.


Well you create your game in GameScene that is already linked to your GameViewController when you create a new project.

If you need a Main Menu Then you need to create another UIViewController in the MainStroyBoard and a swift class in the project.

Then you will have to link that class and UIViewController by clicking on the UIViewController and in properties tab you can select which class you want to link.

After that you will have to create a Segue when your Play Button is clicked you can find more about that HERE

Good Luck!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.