Search code examples
iosanimationcore-animationtweeneasing

Animation tweening in iOS


I'm about to start work on my first big iOS app, but haven't really started any code yet... So it's all theoretical, and in my head at the moment as I'm still in the design phase. 

Regardless, I know I'm going to need some animation effects in the app, so I'm just doing some research.  In Flash (AS3), there are libraries like Tweener, and TweenLite that have TONS of easing options available.

Am I crazy, or are there really no other easing options available besides the four standard ones: 

  • UIViewAnimationCurveEaseIn
  • UIViewAnimationCurveEaseOut
  • UIViewAnimationCurveEaseInOut
  • UIViewAnimationCurveEaseOut

Am I really going to have to dig into deep core animation to accomplish this? Or does anyone know of some 3rd party SDK that'll come in handy.

Thanks all...


Solution

  • Actually, there is one other: UIViewAnimationCurveLinear... Wow, that's a downer. The reason you're seeing such limited options, is because you've only explored UIView's Core Animation wrapper. Core Animation is much more powerful, and capable than that. If you need absolute fine-grain control over your animation, use CAKeyFrameAnimations, and if you need soft-grain control, use CAAnimation and CABasicAnimation. Even CATransaction will work. Basic easing curves were built into iOS because you are expected to provide the instructions for interactions more complicated than that. See here for an excellent series of easing curves that work great with CAKeyframeAnimation. Of course, this isn't for everyone... So there's a beta framework available with built-in tweeting values here