This project contains sample codes of mixing UIKit and SpriteKi.
Here is Source Codes for this sample.
When the user tapped a button, call addParticle function.
internal func addParticle(center:CGPoint){
if let node = SKEmitterNode(fileNamed: "ParticleTest_1") {
node.position = center
self.addChild(node)
node.run(
SKAction.sequence([
SKAction.wait(forDuration: 10.0),
SKAction.removeFromParent()
])
)
}
}
Here is Source Codes for this sample.