Reputation: 4727
I just want to animate snowflakes/other objects in the background falling down. I know a couple of ways to do this, but am really looking for the most efficient solution. I could use this doing a UIView block animation. I would have it start at the top of the screen and animate to the bottom of the screen over a period of time, then on completion start it again at the top. Is that a good way to do it? I'm looking for efficiency here.
Upvotes: 5
Views: 4535
Reputation: 426
As previously answered by Randall and Javy you want a CAEmitterLayer and you probably want to configure it with a live preview like Particle Designer, which doesnt work with CAEmitterLayer.
For CAEmitterLayer you could use Particle Playground (Mac App Store) to configure your emitter on your mac in a simulator and the export it as code ready for integration in your project. PP is quite similar to Particle Designer.
Upvotes: 0
Reputation: 8720
It's only $8 for 71Squared's emitter. You can pretty much copy and paste the code. But it's biggest advantage is configuring the particles exactly the way you want, which can be more time-consuming than figuring out how to make particles in the first place.
http://particledesigner.71squared.com/
Upvotes: 2
Reputation: 14839
You want a CAEmitterLayer! http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAEmitterLayer_class/Reference/Reference.html
It's iOS 5 only though.
Upvotes: 6