Created
January 6, 2013 16:53
-
-
Save anonymous/4468522 to your computer and use it in GitHub Desktop.
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)pulseView:(UIView *)view completion:(void (^)(void))block { | |
// No need for fancy keyframe animation, we can fake this good enough... | |
[UIView animateWithDuration:0.05 delay:0 options:UIViewAnimationCurveEaseInOut animations:^(void) { | |
view.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMakeScale(0.7, 0.7)); | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.12 delay:0 options:UIViewAnimationCurveEaseInOut animations:^(void) { | |
view.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMakeScale(1.1, 1.1)); | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationCurveEaseInOut animations:^(void) { | |
view.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMakeScale(0.9, 0.9)); | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.09 delay:0 options:UIViewAnimationCurveEaseInOut animations:^(void) { | |
view.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMakeScale(1.05, 1.05)); | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.08 delay:0 options:UIViewAnimationCurveEaseInOut animations:^(void) { | |
view.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMakeScale(0.95, 0.95)); | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.05 delay:0 options:UIViewAnimationCurveEaseInOut animations:^(void) { | |
view.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMakeScale(1.0, 1.0)); | |
} completion:^(BOOL finished) { | |
if (block != NULL) { | |
block(); | |
} | |
}]; | |
}]; | |
}]; | |
}]; | |
}]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment