在SpriteViewController中
在Apple的Obj-C中:
- (void)viewDidLoad
{
[super viewDidLoad];
SKView *spriteView = (SKView *) self.view;
spriteView.showsDrawCount = YES;
spriteView.showsNodeCount = YES;
spriteView.showsFPS = YES;
}
在斯威夫特,我:
super.viewDidLoad()
if let spriteView: SKView = self.view as? SKView {
spriteView.showsDrawCount = true
spriteView.showsNodeCount = true
spriteView.showsFPS = true
println("It works! :)");
} else {
println("It doesn't work! :(")
}
我总是得到"它不起作用! :("
有人能告诉我我做错了吗?
如果您想了解有关该项目的更多信息,请see this.
谢谢!