
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 1.27 KB | hits: 12 | expires: Never
UIView Animation Blocks Crash in Instruments Only
CGRect frame = self.buzzMeBtn.frame;
frame.origin.x = 105.0f;
frame.origin.y = 200.0f;
self.buzzMeBtn.frame = frame;
self.buzzMeBtn.hidden = NO;
frame.origin.y = 120.0f;
[UIView animateWithDuration:.15f animations:^(void){
self.buzzMeBtn.frame = frame;
} completion:^(BOOL finished){
// Define the three stages of the animation in forward order
AnimationBlock makeSmall = ^(void){
self.buzzMeBtn.transform = CGAffineTransformMakeScale(0.6f, 0.6f);};
AnimationBlock makeLarge = ^(void){
self.buzzMeBtn.transform = CGAffineTransformMakeScale(1.15f, 1.15f);};
AnimationBlock restoreToOriginal = ^(void) {
self.buzzMeBtn.transform = CGAffineTransformIdentity;};
// Create the completion blocks in reverse order
CompletionBlock shrinkBack = ^(BOOL finished) {
[UIView animateWithDuration:0.2f animations:restoreToOriginal];};
//[UIView animateWithDuration:0.2f animations:restoreToOriginal completion: reenable];};
CompletionBlock bounceLarge = ^(BOOL finished){
[UIView animateWithDuration:0.2 animations:makeLarge completion:shrinkBack];};
// Start the animation
[UIView animateWithDuration: 0.1f animations:makeSmall completion:bounceLarge];
}];