In the method of the button create the new view and add it as a subview. Set the frame.origin.x
to 0 minus the width of the view (if you want it to push from the left) so it is not visible and change that value to where you want it to be inside [UIView animateWithDuration:animations:]
.
[UIView animateWithDuration:1.0 animations:^(void){
[newView setFrame:({
CGRect frame = newView.frame;
frame.origin.x = 150; // If you want it to start at x = 150
frame;
})];
// If you want to move other views too, just add them in this block
}];
If you don't get what I'm doing to set the frame, check out the first tip in this post.