I'm wondering if it's possible to "animate" a variable value. I'd essentially like to have a value change from x to y over a certain amount of time and cause a call to drawRect:
on each iteration. The change in the variable value will affect how drawRect:
processes.
I have thought of doing this manually, but I don't trust a number of things:
- The accuracy of my custom UIViewAnimationCurveEaseInOut
- The frequency of my iterations (if they're too frequent / hard on the GPU or too infrequent / laggy animations)
- The transitions between sleeping and graphical processing using GCD
I've thought of using a KeyFrame animation, but I don't know how I would use the keys, properly.
Is there a way to do this using the built in animation schemes of iOS?