My next iOS app will be my first attempt at having some basic animation beyond the core UI controls provided by the SDK.
This isn't anything complicated. I essentially need to display 5-6 icons on the screen, move them along straight lines, have them fade in and out as a set, and potentially draw lines that visually connect specific icons to each other.
OpenGL ES seems like it's probably overkill for this, as does Quartz 2D (?) 开发者_JAVA技巧but what's the best way in terms of (a) ease of programming and (b) minimizing performance/memory impact?
Should I rely solely on UIKit, making each icon its own view or layer? UIView seems to have all the basic animation (fade, move) capabilities I'll need.
UIKIt and CoreAnimation whenever possible. It's very easy to animation, move views around, and create effects between views using CA. You'll use bits and pieces of Quartz to draw little bits, but for the most part you shouldn't have to write drawing code at all.
UIViews are extremely cheap objects to create and draw, assuming you don't do anything crazy. You can throw hundreds of UIImageViews on the screen and animate them around while barely stressing the CPU.
There are a couple UIKit & Core Animation drawing session videos from WWDC 2011, I recommend you watch them - it's a wealth of information that doesn't exist anywhere else.
精彩评论