UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectZero];
[self.containerView addSubview:myLabel];
CGRect destination = CGRectMake(5, 5, 100, 100); //for instance
[UIView beginAnimations:@"animationIdentifierString" context:nil];
myLabel.frame = destination;
[UIView setAnimationDuration:0.5f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; //that's the default, actually, but set whatever you want there.
[UIView commitAnimations];
I just typed this right in here, so beware of typos. But this is the idea. Wrap changes to UIView subclasses in a call to [UIView beginAnimations: context:]
and [UIView commitAnimations]
, set some configurations on the animations inside there, and boom, you're animating.
There are other ways to do it, but for my money this is the simplest.
Way more detail in the UIView class reference at http://developer.apple.com/iphone/library/documentation/uikit/reference/UIView_Class/UIView/UIView.html