Created
June 14, 2012 02:06
-
-
Save toranb/2927696 to your computer and use it in GitHub Desktop.
updated animate view down method (now with blocks)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (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