Skip to content

Instantly share code, notes, and snippets.

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