Effect: View from large-small zoom display/small-large (only proportional problem)
Method 1: When you show the view directly,
Add the following code to Viewcontroller or view when it appears.
Self.view.transform = Cgaffinetransformmakescale (1.0f, 1.0f);//The view to be displayed is displayed in normal proportions
[UIView Beginanimations:nil Context:uigraphicsgetcurrentcontext ()];
[UIView Setanimationcurve:uiviewanimationcurveeaseinout]; InOut means to start an animation when entering and going out
[UIView setanimationduration:0.5f];//Animation time
Self.view.transform=cgaffinetransformmakescale (0.01f, 0.01f);//show the view to the minimum until it disappears
[UIView commitanimations]; Start animation
Conversely, if you want to display the effect from small to large, swap the scale
Uigraphicsgetcurrentcontext is rich in stuff.
——————————————————————————————————————————
Method 2.push a Viewcontroller:
Add the following code to the push method is OK
catransition *mytranstiton = [Catransition animation];
mytranstiton.duration = 0.5;
mytranstiton.type = kcatransitionfade;
Mytranstiton.subtype = kcatransitionfromtop;
[ Self.view.superview.layer addanimation:mytranstiton forkey:nil];
mainviewcontroller * _mainviewcontroller=[[mainviewcontroller alloc] init];
[self Presentmodalviewcontroller:_mainviewcontroller Animated:NO];