//Show animation-------
loginViewController.view.frame = CGRectMake(0, 0, self.window.frame.size.width, self.window.frame. size.height);
loginViewController.view.transform = CGAffineTransformMakeScale(0.0001, 0.0001);
loginViewController.view.layer.anchorPoint = CGPointMake(0, 0);
loginViewController.view.layer.position = CGPointMake(0, 0);
[UIView animateWithDuration:0.6f delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
loginViewController.view. transform = CGAffineTransformMakeScale(1.0, 1.0);
} completion:^(BOOL finished){
}];
//Hide animation-------
loginViewController.view.layer.anchorPoint = CGPointMake(0, 0);
loginViewController.view.layer.position = CGPointMake(0, 0);
[UIView animateWithDuration:0.6f delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
// loginViewController. view.alpha = 0.0f;
loginViewController. view. transform = CGAffineTransformMakeScale(0.0001, 0.0001);
} completion:^(BOOL finished)
{
//NSLog(@"sliding finished...");
[loginViewController removeFromParentViewController];
[loginViewController. view removeFromSuperview];
}];
Change the anchor point and position, to try different animations..
No comments:
Post a Comment