Q:

Objective-c Hidden View animation

Hello I have a hidden view inside of my view that appears by the click of a button. But when you click on the button I want the view to do an slide up animation so it won't just appear but slide up to it's position.
Here is the code for my hidden view:
in .h:
@interface hidden_viewsViewController : UIViewController {

    IBOutlet UIView *loginview;

}

@property (nonatomic, retain) IBOutlet UIView *loginview;

- (IBAction)login;
- (IBAction)logout;

And in .m
@synthesize loginview;

- (IBAction)login {

    loginview.hidden = NO;

}

- (IBAction)logout {

    loginview.hidden = YES;

}

- (void)viewDidLoad {
    [super viewDidLoad];

    loginview.hidden = YES;
}

A:

Try, assuming the view is in portrait orientation:
- (IBAction)login {
    [self.view bringSubviewToFront:loginView];
    loginview.frame = CGRectMake(0, 480, 320, 480); 
    loginview.hidden = NO;
    [UIView animateWithDuration:1.0 
                     animations:^{
                         loginview.frame = CGRectMake(0, 0, 320, 480);
                     }];
}

