Created
February 8, 2012 10:27
-
-
Save JonB/1767992 to your computer and use it in GitHub Desktop.
CA Test
This file contains 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
- (IBAction)goButtonPressed:(id)sender | |
{ | |
CALayer *layer = self.theRedSquare.layer; | |
CATransform3D initialTransform = self.theRedSquare.layer.transform; | |
initialTransform.m34 = 1.0 / -1000; | |
layer.transform = initialTransform; | |
layer.anchorPoint = CGPointMake(0.0, 0.5); | |
[UIView beginAnimations:@"com.jon.Scale" context:nil]; | |
[UIView setAnimationDuration:1]; | |
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut]; | |
CATransform3D rotationAndPerspectiveTransform = self.theRedSquare.layer.transform; | |
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI , 0 , -self.theRedSquare.bounds.size.height/2, 0); | |
layer.transform = rotationAndPerspectiveTransform; | |
[UIView setAnimationDelegate:self]; | |
[UIView commitAnimations]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment