Skip to content

Instantly share code, notes, and snippets.

@xissburg
Created July 5, 2011 02:29
Show Gist options
  • Save xissburg/1064166 to your computer and use it in GitHub Desktop.
Save xissburg/1064166 to your computer and use it in GitHub Desktop.
- (void)tapAction:(UITapGestureRecognizer *)sender
{
CATransform3D t = CATransform3DIdentity;
t = CATransform3DRotate(t, -M_PI/6, 0, 0, 1);
t = CATransform3DTranslate(t, 0, 200, 0);
[CATransaction begin];
[CATransaction setCompletionBlock:^(void) {
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithDouble:1] forKey:kCATransactionAnimationDuration];
self.maskLayer.transform = CATransform3DIdentity;
self.squareView.layer.transform = CATransform3DIdentity ;
[CATransaction commit];
}];
[CATransaction setValue:[NSNumber numberWithDouble:1] forKey:kCATransactionAnimationDuration];
self.maskLayer.transform = t;
self.squareView.layer.transform = t;
[CATransaction commit];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment