The SpriteKit scene is presented on an instance of SKView, which is a subclass of UIView.
For an iOS game created using SpriteKit, you must configure at least one viewController, either programmatically in the application delegate or in a storyboard on which SKScene can be displayed. On the main screen of this VC, SKScene will be presented.
So, if you are using a storyboard, an iOS game will have to instantiate the root viewController. You can easily create your user interface on the viewController and present the game from the code by pressing a button either in the same viewController mode or in a new one. All of this will be apparent after you read SpriteKit's primer using Swift, like this .
Say your root viewController has your main menu (in another view called menuView), with a play button on it. Now the representation of the game by pressing a button will look something like this:
class MyViewController: UIViewController { @IBOutlet wear var menuView: UIView? @IBOutlet weak var playButton: UIButton? @IBAction func likedThis(sender: UIButton) {
As for returning to the main menu from the scene, look at this answer .
source share