Skip to content

Instantly share code, notes, and snippets.

@shaunoconnor
Created April 13, 2011 05:57
Show Gist options
  • Select an option

  • Save shaunoconnor/917040 to your computer and use it in GitHub Desktop.

Select an option

Save shaunoconnor/917040 to your computer and use it in GitHub Desktop.
//
// AnimatedView.h
// BlocksAnimation
//
// Created by Shaun O'Connor on 13/04/11.
//
#import "AnimatedView.h"
@implementation AnimatedView
@synthesize animation;
- (void)dealloc
{
[super dealloc];
[animation release];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[UIView animateWithDuration:0.6
delay:0
options:UIViewAnimationOptionAutoreverse
animations:^{
[UIView setAnimationRepeatCount:1.0];
self.transform = CGAffineTransformMakeScale(0.1, 0.1);
}
completion:^(BOOL finished){
self.transform = CGAffineTransformIdentity;
[[NSNotificationCenter defaultCenter] postNotificationName:@"VIEW_ANIMATION_COMPLETE" object:self];
}];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment