CODEX

How to Add SpriteKit to Your iOS App

Connect SpriteKit and UIKit to give your app some action

Artturi Jalli
CodeX
Published in
4 min readJan 11, 2021

--

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 an SKView 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.

--

--

Artturi Jalli
CodeX

Check @jalliartturi on YouTube to become a successful blogger. (For collabs, reach me out at: artturi@bloggersgoto.com)