I have this subview I want to add to my main view, but make it expand from the origin. I read some of the Apple documentation but I don\'t understand where I am making mistake.
To make a view "grow" into place, don't animate the frame. Animate the transform.
Load your subview from the nib. Set its transform to a scale of 0:
view.transform = CGAffineTransformMakeScale(0,0);
Then add it to your superview.
Inside the animation block, set the transform to identity:
view.transform = CGAffineTransformIdentity;
And the view will grow to normal size. You may need to fiddle with the anchor point to make it grow from the right point.
You can also change the frame within the block, but to move a view only I prefer to change the center property, you shouldn't try to set the frame if you also have a transform.
For bonus points, you can also animate to a slightly bigger than 1.0 scale, then animate back to the identity transform in a chained animation from the completion block. This makes the view "pop" out of the screen like an alert view.