I'm trying to move a UIVIew across the screen. I don't want to use CoreAnimation because I need to be able to vary the velocity of the view in real-time.
At the moment I have the following hierarchy:
UIView
-- UIView (subview)
I'm sub-classing the parent view and adding an update method.
-(void) update: (float) dt {
float newX = _subView.transform.tx + dt * dxdt;
[_subView setTransform: CGAffineTransformMakeTranslation(newX, 0)];
}
The update method is called every frame and I was hoping that this would cause the sub view to be animated.
Unfortunately it doesn't move. I've tried:
[_subView setNeedsDisplay]
But it still doesn't work. There must be something I'm missing to force the view to re-draw.