Can't use SpriteKit in Xcode 6 playground

I am trying to use SpriteKit in Xcode 6 playground like this:

import UIKit
import SpriteKit
import XCPlayground

var spriteView = SKView(frame: CGRectMake(0, 0, 1334, 650))
spriteView.backgroundColor = UIColor(red: 0.167, green: 0.165, blue: 0.164, alpha: 1.0) 
let rootScene = SKScene()

let rect = SKShapeNode(rect: CGRectMake(10, 10, 100, 100))

rect.fillColor = UIColor.redColor()

rootScene.addChild(rect)

spriteView.presentScene(rootScene)

XCPShowView("The Sprite View", spriteView)

      

But when I see the Timeline, I just see:

Xcode Playground

Can anyone help me?

+3


source to share


1 answer


It looks like iOS playgrounds don't work well with SpriteKit. I got mixed results on the playground in the full simulator:

Full Simulator screenshot



And works reasonably under OSX using the previously created .sks in the Resources folder of the playground (just like the Balls Example )

Found this comment .

0


source







All Articles