I spent a couple of hours trying to position a UIView and eventually figured out that I needed to modify the views frame. So I added a 'setPosition' method to the UIViewController subclass like this
- (void) setPosition:(CGPoint)position
{
CGRect newFrame = self.view.frame;
newFrame.origin.x = position.x;
newFrame.origin.y = position.y;
self.view.frame = newFrame;
}
However, that seems so simple that I don't understand why UIViews don't have this method already, which makes me think this might not be the right way to do it. So that's my question...
Is this method OK or am I doing something I shouldn't be doing... for some reason?