Skip to content

Instantly share code, notes, and snippets.

@TheCodeEngine
Last active October 11, 2015 00:08
Show Gist options
  • Save TheCodeEngine/3772092 to your computer and use it in GitHub Desktop.
Save TheCodeEngine/3772092 to your computer and use it in GitHub Desktop.
Animation Block
typedef void (^AnimationBlock)(void);
typedef void (^CompletionBlock)(BOOL finished);
//
// AnimationBlock
AnimationBlock first = ^(void){
self.transform = CGAffineTransformMakeScale(0.5f, 0.5f);
};
AnimationBlock second = ^(void){
self.transform = CGAffineTransformMakeScale(1.15f, 1.15f);
};
AnimationBlock third = ^(void){
self.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
};
//
// Completion Links
CompletionBlock Second = ^(BOOL finished){
[UIView animateWithDuration:0.2f animations:third completion:nil];
};
CompletionBlock First = ^(BOOL finished){
[UIView animateWithDuration:0.2f animations:second completion:Second];
};
[UIView animateWithDuration:0.2f animations:first completion:First];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment