Skip to content

Instantly share code, notes, and snippets.

@toranb
Created June 14, 2012 02:06
Show Gist options
  • Select an option

  • Save toranb/2927696 to your computer and use it in GitHub Desktop.

Select an option

Save toranb/2927696 to your computer and use it in GitHub Desktop.
updated animate view down method (now with blocks)
- (void)animateViewDown:(NSUInteger)size
{
[self animateView:^(CGRect frame)
{
frame.origin.y -= size;
frame.size.height += size;
return frame;
}
];
}
- (void)animateView:(CGRect (^)(CGRect))block
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
self.view.frame = block(self.view.frame);
[UIView commitAnimations];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment