I have an ordinary .sks file in Xcode9, TestScene.sks.
Of course, you need an SKView to "hold" an .sks.
If I manually construct the SKView in code in the usual way it works fine. (I've included a handy example of that at the bottom of this post.)
However, in X9 you can simply add a SKView in storyboard.
And then just choose the .sks file in the Attributes inspect....
But.
It does not work. I just get this error:
Main.storyboard: Class Unavailable Xcode.IDEInterfaceBuilder.CocoaTouch.SKView
What could the problem be?
SpriteKit.framework is included in Link Binary ...
what could be the reason?
Point 1: for the record, how to manually add in code:
func manuallyAddSceneInCode() {
let sk: SKView = SKView()
sk.frame = view.bounds
sk.backgroundColor = .clear
view.addSubview(sk)
let scene = SKScene(fileNamed: "TestScene")!
scene.scaleMode = .aspectFit
scene.backgroundColor = .clear
sk.presentScene(scene)
}
Point 2 - as Knight asks below. If you "just drop a regular UIView and custom class it to SKView" - of course, you then don't get any of the "custom controls" for the class. (Just as if you say custom class a normal UIView to UILabel - it does not "work like" a UILabel in storyboard.)
Point 3 - Knight seems to have hit a nail on the head, indeed the class mentioned in the error is "Xcode.IDEInterfaceBuilder...." what the heck is that?
Point 4, I just tried in 9.0.1, same problem.