pomo_mondreganto
pomo_mondreganto

Reputation: 2074

Using SpriteKit in AppKit app swift

I'm writing some games for Mac OS (using AppKit with storyboards and without core data) and my project is quite big, so rewriting it using SpriteKit will be very difficult and long process. So, is there any way to add a game written on SpriteKit to this project?

Upvotes: 0

Views: 208

Answers (1)

rickster
rickster

Reputation: 126107

This is exactly what the SpriteKit Game template you can start a new app with in Xcode is. There's nothing magic about it — it's an AppKit app, containing an SKView that displays an SKScene.

Take a look at a new project created with that template to see how it works. Create an SKView in code or in IB, make an outlet to it, and from your app's controller code (say, in the app delegate or a window controller), create a scene and pass that to the view's presentScene method.

Upvotes: 1

Related Questions