-
-
Hi! I'm Michael Tyson, and I run A Tasty Pixel from our home in the hills of Melbourne, Australia. I write on a variety of technology and software development topics. I've also recently returned from a 3.5-year journey around Europe in a motorhome.
I make Loopy, the live-looper for iOS, Audiobus, the app-to-app audio platform, and The Amazing Audio Engine, the iOS audio framework.
iPhone/Mac animation for custom classes: Property animation for more than just CALayer
I recently wrote a custom view — a 3D vintage-looking pull lever — that provided a continuous property to control the state. I wanted to animated this smoothly, a-la CABasicAnimation, but couldn’t find a built-in way to do so.
So, I wrote a class that provides similar functionality to CABasicAnimation, but works on any object. I thought I’d share it.
Features:
NSNumber
and scalar numeric types, but easily extendable)chainedAnimation
, and it’ll be fired once the first animation completes)CADisplayLink
if available, to update in sync with screen updatesUse it like this:
Make sure you also include the QuartzCore framework, used to access
CADisplayLink
, if it’s available.It’s BSD-licensed.
Grab it here: TPPropertyAnimation.zip