Skip to content

Instantly share code, notes, and snippets.

@nalitzis
Created October 13, 2012 16:18
Show Gist options
  • Save nalitzis/3885194 to your computer and use it in GitHub Desktop.
Save nalitzis/3885194 to your computer and use it in GitHub Desktop.
animation when deleting a view
- (IBAction)deleteTapped:(id)sender {
[_delegate contentViewWillDelete:self];
[UIView animateWithDuration:0.5 animations:^{
self.alpha = 0.0f;
CGAffineTransform rotate = CGAffineTransformRotate(self.transform, 1);
CGAffineTransform translate = CGAffineTransformTranslate(self.transform, 300, -100);
self.transform = CGAffineTransformConcat(rotate, translate);
} completion:^(BOOL finished){
[self removeFromSuperview];
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment