In Xcode 6 beta 2 it worked fine, but in beta 4 it doesn't work anymore. Does anyone know what's behind this mystery?
let circle = SKShapeNode(circleOfRadius: 125);
circle.strokeColor = UIColor(red: 255, green: 255, blue: 255, alpha: 1.0);
circle.lineWidth = 4
self.addChild(circle);
In beta 4 nothing can be seen.
Thanks for your help in advance.
This is a common issue with Xcode 6 Beta 4 when using the simulator. It renders fine when using an actual device. See this developer forums thread. It is worth noting that the issue is exclusive to stroking in that setting circle.fillColor
still fills the circle (or whatever your SKShapeNode
is drawing) correctly.
Also keep in mind that when initializing a UIColor
with RGB values the RGB values must be between (inclusive) 0.0 and 1.0.
circle.strokeColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0);
Or alternatively use the preset:
circle.strokeColor = UIColor.whiteColor()