I'd like to take advantage of the particle effects (and maybe some other stuff) in SpriteKit but my app is mainly rooted in UIKit. Does the SpriteKit framework allow you to create a scene with a transparent background that I can place on top of my UIKit view hierarchy?
3 Answers
Short answer is no. You can add SKView (subclass of UIView) to your view hierarchy, and set its scene to your own SKScene. But SKView has a backgroundcolor property that cannot be clear (defaults to grey). It seems possible in OSX mavericks, so hopefully apple will add this possibility in iOS as well.

- 1,332
- 8
- 15
If your app is mainly rooted in UIKit, Sprite Kit probably isn't the best way to get spiffy visual effects. Some alternatives:
- Core Animation provides a particle system in the
CAEmitterLayer
class. - UIKit has dynamic, physics-based behaviors for animating UI elements.

- 124,678
- 26
- 272
- 326
As of iOS 8, Apple has added this ability: see SKView.allowsTransparency
.
https://developer.apple.com/documentation/spritekit/skview/1519697-allowstransparency
It defaults to false
, yielding the black rectangle background you see; but set it to true
, set its background color to .clear
, and it composites over UIKit content just fine.
Further info: Removing Background of SKView - Particle Emitter - SpriteKit

- 7,385
- 2
- 31
- 41