###项目
Sprite Kit for Kids with Swift
###编译错误
编译环境:
Xcode Version 6.2 (6C131e)
OS X 10.9.51
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17override func viewWillLayoutSubviews() {
super.viewDidLoad()
let skView = self.view as! SKView
if skView.scene == nil {
let scene = GameScene(size:skView.frame.size)
skView.showsFPS = true
skView.showsNodeCount = true
skView.showsPhysics = true
skView.ignoresSiblingOrder = true
scene.scaleMode = .AspectFill
skView.presentScene(scene)
playBackgroundMusic("BackgroundMusic.mp3")
}
错误信息
Expected type after ‘as’
解决方法as!
===>as
1 | override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) { |
错误信息
Use of undeclared type ‘Set’
解决方法Set<NSObject>
===>NSObject