[Code Note] iOS-Transition animation, note ios-transition
1. Engineering Drawing.
Ii. Code.
RootViewController. h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController@end
RootViewController. m
# Import "RootViewController. h "# import" FirstViewController. h "@ interface RootViewController () @ end @ implementation RootViewController-(id) initWithNibName :( NSString *) bundle :( NSBundle *) handle {self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]; if (self) {// Custom initialization} return self;}-(void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. self. title = @ "Homepage"; self. view. backgroundColor = [UIColor redColor];/* transition effect fade // cross fade transition (transition direction not supported) push // The New View pushes the old view out of moveIn // The New View is moved to the old view and reveal // removes the old view, show the following new view cube // cube tumble effect oglFlip // top, bottom, left, and right flip effect suckEffect // contraction effect, such as a piece of cloth being drawn (transition direction not supported) rippleEffect // drip effect (transition direction not supported) pageCurl // page up effect pageUnCurl // page down effect cameraIrisHollowOpen // camera lens opening effect (transition direction not supported) cameraIrisHollowClose // camera lens Closing effect (transition direction not supported) * // * transition direction fromRight; fromLeft; fromTop; fromBottom; */}-(void) touchesBegan :( NSSet *) touches withEvent :( UIEvent *) event {CATransition * transition = [CATransition animation]; // animation time control transition. duration = 0.3f; // the speed at which the animation starts and ends. timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut]; // whether to proxy transition. delegate = self; // After the animation is executed, it is automatically removed. The default value is true transition. removedOnCompletion = NO; // various animation effects transition. type = kCATransitionMoveIn; // specifies the animation direction. subtype = kCATransitionFromTop; FirstViewController * viewCon = [[FirstViewController alloc] init]; [self. navigationController pushViewController: viewCon animated: NO]; // Add the Code [self. navigationController. view. layer addAnimation: transition forKey: nil];}-(void) didReceiveMemoryWarning {[super didreceivemorywarning]; // Dispose of any resources that can be recreated .}