Skip to content

Instantly share code, notes, and snippets.

@mudphone
Created July 21, 2010 11:19
Show Gist options
  • Save mudphone/484353 to your computer and use it in GitHub Desktop.
Save mudphone/484353 to your computer and use it in GitHub Desktop.
- (void) shrinkFrame {
void (^myBlock)(void);
myBlock = ^(void) {
CGRect frame;
frame = self.frame;
frame.size.width /= 1.5;
frame.size.height /= 1.5;
self.frame = frame;
};
[self animateBlock:myBlock];
}
- (void) animateBlock:(void ( ^ )( void ))theBlock {
[UIView beginAnimations:nil context:nil];
theBlock();
[UIView commitAnimations];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment