What is the difference between SKView and SKScene

At Apple Docs ..

SKView: "The SKView is a view that displays the contents of the Sprite Kit. This content is provided by the SKScene."

SKSCene: "The SKScene object is a content scene in a sprite set."

What's the difference? Is SKScene similar to a view controller and SKView similar to a UIView?

+8
ios objective-c sprite-kit
source share
1 answer

SKView is a subclass of UIView. It covers the contents of the Sprite Kit in a view that can be used like any other Cocoa view. Usually it has an associated view controller. This is the connection of the Sprite Kit to the Cocoa world.

A scene is the root object of a scene graph. It provides callbacks (physics, scene change, update) necessary for the implementation of the game. It does not apply to anything Cocoa.

Usually, the presentation remains the same as if you can imagine scenes to replace game content, for example, moving from a menu to a game scene. Internally, the view also caches resource files in memory, as you switch scenes, they don’t need to reload the same textures.

+8
source share

All Articles