Skip to content
Maciej Walczynski edited this page Oct 23, 2013 · 4 revisions

Animations of views

  1. Animations with block
    [UIView animateWithDuration:0.5
                          delay:1.0
                        options: UIViewAnimationOptionCurveEaseOut
                     animations:^{
//                         change properties
                     }
                     completion:^(BOOL finished){
                         NSLog(@"Done!");
                     }];
  1. Animations begin, commit
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelay:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];

// change properties
 
[UIView commitAnimations];
  1. Custom transition
[UIView beginAnimations:@"Custom transition" context:nil];
[UIView setAnimationDuration: 0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown 
                           forView:self.navigationController.view 
                             cache:YES];
[self.navigationController pushViewController:self.detailViewController animated:YES];
[UIView commitAnimations];
  1. Create an app that will move the view on tap gesture

Clone this wiki locally