-
-
Save xieweizhi/06bac099d8de6bae47d3 to your computer and use it in GitHub Desktop.
Book cover flip animation on iOS (Path app style)
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
#import <QuartzCore/QuartzCore.h> | |
UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; | |
splashView.image = [UIImage imageNamed:@"Default.png"]; | |
[self.window addSubview:splashView]; | |
[self.window bringSubviewToFront:splashView]; | |
splashView.layer.anchorPoint=CGPointMake(0, .5); | |
splashView.center = CGPointMake(splashView.center.x - splashView.bounds.size.width/2.0f, splashView.center.y); | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:1]; | |
[UIView setAnimationDelay:1]; | |
splashView.transform = CGAffineTransformMakeTranslation(0,0); | |
CATransform3D _3Dt = CATransform3DIdentity; | |
_3Dt =CATransform3DMakeRotation(3.141f/2.0f,0.0f,-1.0f,0.0f); | |
_3Dt.m34 = 0.001f; | |
_3Dt.m14 = -0.0015f; | |
splashView.layer.transform =_3Dt; | |
[UIView commitAnimations]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment