I’m trying to make a rectangle move across the iPhone screen by changing its x value then redrawing. I’m new to Objective C, can someone point me to a tutorial on how to do this? It doesn’t look like DrawRect accepts parameters, should I make a public variable to store the rectangle x value?
It looks like I need to run a for loop to scale through x values for the rectangle incrementally, and after each x is changed call setNeedsDisplay. I have quite a few files and default functions I don’t recognize already. Where would it be appropriate to place the for loop?
You can use the UIView transformation methods. Just go to the documentation and search for UIView and there should be an animations section. It is quite easy actually. I would post code here, but that should be self explanatory.
Something like this: