Reputation: 3612
Im doing a transition from Obj-C to Swift and after 5 seconds I'm stuck :/
@IBOutlet var scene: SCNView!
I get the error:
'weak' cannot be applied to non-class type '<<error type>>'
Use of undeclared type 'SCNView'
What is this?
I'm using latest Xcode 6.3.
Upvotes: 3
Views: 1884
Reputation: 126107
You need to tell Swift about the frameworks (modules) you intend to use in a source code file with the import
statement, just like you tell ObjC about such using #import
or #include
.
import SceneKit
class MyViewController: UIViewController {
@IBOutlet var sceneView: SCNView!
// ...
}
This both makes the classes, functions and other symbols available for use in your source file and makes Xcode link in the SceneKit framework binary when building your app.
Upvotes: 6