I opened spritekit app sample and than added this code
override func didMoveToView(view: SKView) {
/* Setup your scene here */
var shapeNode = SKShapeNode(rect: view.frame)
shapeNode.strokeColor = UIColor.redColor()
shapeNode.lineWidth = 4;
shapeNode.position = CGPoint(x: 0, y: 0)
self.addChild(shapeNode)
}
which simply tries to add 4width border in the main view but instead of that output was,
So what am I doing wrong?
This is because your scene is being scaled. To fix the issue change your scene scale mode (in the GameViewController) to
scene.scaleMode = .ResizeFill
To see why this is, I recommend you read my answer here