Last active
October 11, 2015 00:08
-
-
Save TheCodeEngine/3772092 to your computer and use it in GitHub Desktop.
Animation Block
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
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