Search code examples
ios8sprite-kitskshapenode

Is SKShapeNode strokeColor broken on ios8?


Using the simulator (iPhone 4s,5,6), I've discovered that on iOS7 the following code works fine, but on iOS8 the stroke is not drawn. (w and h are defined elsewhere).

SKShapeNode* userGuessSpace = [SKShapeNode node];
CGPathRef ref = CGPathCreateWithRect(CGRectMake(0,0,w,h),nil);
userGuessSpace.fillColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.35];
userGuessSpace.strokeColor = [UIColor colorWithRed:255 green:255 blue:255 alpha:1];
[userGuessSpace setPath:ref];
CGPathRelease( ref );

Haven't tested on device, is this simulator only or do I have to do something else?

iOS7 White stroke apparent

iOS8 White stroke missing


Solution

  • Reading archived discussions in the apple forums, it appears to be only in Simulation and not on device.

    Anyone confirm this is the right answer? I've not got enough devices, or indeed any device to currently test!

    Apple developer forum post