0

In SpriteViewController

in Obj-C, by Apple:

- (void)viewDidLoad
{
    [super viewDidLoad];
    SKView *spriteView = (SKView *) self.view;
    spriteView.showsDrawCount = YES;
    spriteView.showsNodeCount = YES;
    spriteView.showsFPS = YES;
}

in Swift, by me: 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! :(")
}

I always get "It doesn't work! :(".

Can someone tell me what I'm doing wrong?

If you'd like to know more about the project in general, see this.

Thanks!

Fine Man
  • 455
  • 4
  • 17
  • 1
    It looks like your view is not an `SKView`. You can change this in the storyboard. – 0x141E Jul 09 '15 at 19:56
  • @0x141E - Thanks! I was being stupid. Sorry for your time. If you'd like a thumbs-up, post your comment as an answer. I'll be obliged to thumbs-up! – Fine Man Jul 09 '15 at 20:08

0 Answers0