The error message is telling you that there's already a method named scene
defined on the superclass, and your new definition conflicts with it. It's a class method, with Objective-C signature [SCNScene scene]
, which comes across to Swift as init()
. The superclass's scene
method conflicts with your var scene:SCNScene!
. That's the answer to the question you asked.
However...
It makes no sense to have a scene
on a scene
. That's what you've defined.
It is very questionable practice to define one view
property on an SCNScene. A scene can be displayed in multiple views simultaneously. It can be rendered without a view at all.
SCNScene is not meant to be subclassed. There's a discussion of that here: Trouble subclassing SCNScene. Apple SceneKit engineers are on record here as recommending against it. (I painted myself into a corner over the weekend by trying to subclass SCNNode; don't subclass it either!)
The most common practice seems to be to move the initialization code which you've shown us over to your view controller. That's a fairly simple, reasonable approach for a beginner. That architecture, though, makes for very complicated, bloated view controllers. The best approach is to put your game logic in its own game controller class.
Think of the SCNScene as data. Your game controller contains the logic. When you're ready to add a second level to your game, you write a second SCNScene, and load it, using the same game controller. When you're ready to move your game from iOS to OS X or tvOS, you'll deal with writing a new view controller, but can reuse your scenes and your game controller.
Since you're new to Swift, your first stop should be Daniel Steinberg's book "A Swift Kickstart", available on iBooks.