From the course: Advanced iOS App Development: Core Animation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a particle emitter

Creating a particle emitter - iOS Tutorial

From the course: Advanced iOS App Development: Core Animation

Start my 1-month free trial

Creating a particle emitter

- [Instructor] To finish off this last module, we're gonna create a simple particle emitter to simulate fireworks going off on our PartyTime View controller. Using CA emitter layers to create particle effects is a great way to create special kinds of animations. Especially ones that should look realistic. To start things off, let's create a new function underneath the particle emitter mark comment. We'll call this createFireworkEmitter. Now we need an actual CA emitter layer, so we'll say let fireWorksEmitter equals an instance of a CA emitter layer. Now there are a couple ways that we can customize one of these emitters. Most importantly, the layer frame and the emitter shape, position, and size. First off, we want the emitter layer itself to fill the entire screen. So we're gonna say fireWorksEmitter.frame equals view.bounds simple enough. Now the emitter layer houses the actual emitter inside itself. So you can actually have a different layout relative to the parent layer. We want…

Contents