views:

329

answers:

4

I'm learning to program for the iPhone. I'm trying to figure out how to do some really cool custom view animations. What should I learn, Quartz or OpenGL ES?

For whoever says OpenGL ES, could I use it to animate my views or is only Quartz suitable for the task? Thanks.

Also any resources / the book or anything that teaches you this stuff in the most painless manner?

Thanks!

+2  A: 

You can actually animate views without even going into Quartz. There's a lot you can do with UIKit. Apple's documentation recommends:

In general, you should use the highest-level framework that meets the requirements of your application. Use lower-level frameworks only when you need more precise control or more powerful capabilities.

bpapa
A: 

If you want to animate your views, start with Core Animation. It can do a lot for you already. If after trying you can't get the effect you want with CoreAnimation alone, then use it in conjunction with Quartz. If that still can't suit your exact need, then only investigate OpenGL.

Pierre Lebeaupin
+3  A: 

By Quartz, you probably mean Core Animation. Quartz is simply the Mac / iPhone 2-D drawing API, where Core Animation handles animation of views and layers.

It is very difficult to use OpenGL for performing custom animations on views, but Core Animation is designed for this purpose. It has been my recommendation to people that if they are thinking about doing 2-D animations, even in games, they should look at Core Animation first and go to OpenGL ES only if Core Animation's performance is unacceptable. Core Animation lets you do a lot with just a little code, and there are now plenty of great references out there on the topic (such as Marcus Zarra and Matt Long's new book).

You may wish to refer to some of these other questions for more:

Brad Larson
A: 

If you want to animate the movement of views around the screen then core animation is what you want.

If you want to run a custom animation inside a view then you should use OpenGLES for the best performance.

You can do both at once.

Mark Thalman