Search code examples
iosswiftsprite-kituikit

Including a UIKit mini-game into a SpriteKit project


So I've made a quiz app in UIKit, with a question being displayed, four answers to pick from, etc. But since this project includes multiple mini-games, the rest of the project is written in SpriteKit. Is it worth it to rewrite the quiz app in SpriteKit, or is there some way I could include this UIKit mini-game into a SpriteKit project. I've already tried to work with two classes like this:

public class GameScene: SKScene { 

    public var orientation: UIInterfaceOrientation!
    let QuizScene = QuizScene()

    override public func didMove(to view: SKView) {

        fireQuizScene.setUpBushfireQuiz()

    }

} 

But it doesn't seem to work. Any help would be greatly appreciated. Thanks!


Solution

  • Stick with SpriteKit for games, and UIKit for the quiz.

    Apple decided to develop SpriteKit because UIKit just does not have the proper tools to create a game.

    Before Sprite Kit, people were on there own creating context windows out of open gl frame works, and it was a real hassle.

    UIKit has nice features that keep your app responsive across all devices thanks to their constraints, which SpriteKit does not have.

    Sprite Kit and UI kit integrate nicely, so do not fear with having your games in SpriteKit.

    Just have your quiz in UIKit, and pop up an SKView for sprite kit when it is game time.