IOS animation usage Summary
First
CATransition * transition = [CATransition animation]; transition. duration = 0.4f; // time transition. type = kCATransitionPush; // animation effect transition. subtype = kCATransitionFromBottom; // animation destination [self. view addSubview: _ backGroundView]; // you need to add a View. You need to write [self. view. layer addAnimation: transition forKey: @ "animation"];
Second
[UIView beginAnimations: @ "animation" context: nil]; [UIView setAnimationDuration: 2.0f]; // time [UIView setAnimationCurve: timeout]; // effect [UIView setAnimationTransition: Alert forView: self. view cache: YES]; [self. view addSubview: _ backGroundView]; // What to Do [UIView commitAnimations];
Third
[UIView animateWithDuration: 1.0 animations: ^ {_ backGroundView. frame = CGRectMake (0, originY, _ screenSize. width, 0); // status value to be reached} completion: ^ (BOOL finished) {[_ backGroundView removeFromSuperview];}];
To sum up, the first and second types of page switching are usually used, and the third type is generally used to change the status of a page.