I am trying to do some manual “Animation” within a UIview.
I put “Animation” in quotes, in that I am trying to animate movement and display of arbitrary elements which I control – rather than clear and concise movements that are typically done through the UIView Animation blocks. (Think of making a guy walk – as I am drawing different images and different places as a series of “frames”.)
This would be simple do to in Cocos2d, using “nextFrame” – which is continuously re-queued.
I figured I could do drawing inside drawRect, and the setNeedsDisplay at the end of drawRect, which would make the framework immediately send another drawRect event – but this doesn’t seem to work.
I could set up an NSTimer event to setNeedsDisplay at a regular time interval, but this would not allow me to draw at the maximum possible frame rate.
I also tried doing this with layoutSubviews, calling setNeedsLayout at the end of layoutSubviews – but I could never acu
So – how can I do this?
I used an NSTimer to fire an update request, at the max frame rate, as discussed.