CODEX
How to Add SpriteKit to Your iOS App
Connect SpriteKit and UIKit to give your app some action
Today, I will show you how to couple SpriteKit and UIKit together.
I’m going to show how I add my example project, Particles Theme, as the background of a login screen. You can follow these steps to integrate any SpriteKit project into any of your apps.
The Current App
Feel free to repeat the following steps on any of your projects. For the sake of demonstration, I’m going to start with a login screen that has no background:
To bring this view alive, let’s add the Connected Particles Theme in the background. This theme is a SpriteKit Game app. Thus it needs the effort to get it running on a regular app.
1. Add a SpriteKit View to the View Controller
- Go to your
Main.storyboard
and drag anSKView
there. Change the view hierarchy such that other UI elements don’t get hidden by it.
- Feel free to adjust the
SKView
to fit the screen as you like and add some constraints.