NSMutableArray *animations = [[NSMutableArray alloc] initWithCapacity: 1]; // array to hold our animations if there are multiple animations.
CGRect myFrame = = CGRectMake(0.0f, 0.0f, 50.0f, 50.0f); // Make the view's frame
UIView *myView = [ [ UIView alloc ] initWithFrame: myFrame ]; // Init the view.
startFrame = myFrame; // set the start frame as the current position of the view.
endFrame = myFrame; // set the end frame as the current position of the view.
endFrame.origin.y = 50.0f; // move the endFrame 50 pixels down
[mainView addSubview: myView]; // add the subview to mainView
[myView setFrame: startFrame]; // Set the uiview's frame to the start frame just incase it isn't already
UIFrameAnimation *viewAnimation = [ [UIFrameAnimation alloc] initWithTarget: myView]; // set the UIFrameAnimation's target to myView
[viewAnimation setStartFrame: startFrame]; // set the start of the animation.
[viewAnimation setEndFrame: endFrame]; // and the end of the animation.
[viewAnimation setSignificantRectFields: 2]; // forgot what this does but I used it :P
[viewAnimation setDelegate: self]; // set the animation delegate
[animations addObject: viewAnimation]; // add our view to the animations array
[[UIAnimator sharedAnimator] addAnimations:animations withDuration:0.4f start:YES]; // Tell the UIAnimator to animate all animations in our animations array with a duration of 4 tenths of a second and to start it now.
[animations release]; // Release our animations array.
Have fun :)
-MxWeas