I created an .sks
particle emitter based on the spark
template.
My app is a normal app (not a game). When a user clicks a button, I have a new View controller that shows modally over fullscreen
so that I can blur the background.
In this modal, I created a view
and gave it a class of SCNView
see image below:
How can I load the particle .sks
file to do the animation on that viewController on the Particles
view?
Update How to load a SceneKit particle systems in view controller?
.sks
files are SpriteKit particle systems. You can also create SceneKit particle systems in Xcode, they are.scnp
files.A
.scnp
file is basically an archivedSCNParticleSystem
that you can load withNSKeyedUnarchiver
and add to your scene using-addParticleSystem:withTransform:
.As mentioned by @mnuages, you can use
.scnp
file instead of.sks
, which is a SceneKit Particle System.So the steps are:
ConfettiSceneKitParticleSystem.scnp
SCNView
for it like in the printscreen of the questionIn your
UIViewController
:class SomeVC: UIViewController {
}
Et Voila...you have you animation :)