Custom transfer animation library
# Import <quartzcore/quartzcore. h>
@ Interface mycatransition: catransition
// Parameter description:
/******************* Type **************/
// 'Fade ', gradient
// Enter 'movein,
// 'Push' is available
// 'Reveal'. Display
// Cube
// Suckeffect Absorption
// Oglflip flip up and down
// Rippleeffect
// Pagecurl volume page
// Pageuncurl
// Camerairishollowopen camera
// Camerairishollowclose camera
/******************* Subtype **************/
// Fromleft ',
// 'Fromright ',
// 'Fromtop'
// 'Frombottom'
/******************* Timingfunction **************/
// Timingfunction:
// Linear ',
// 'Easein ',
// 'Easeout'
// 'Easeineaseout'
//
// Custom transfer Animation
+ (Mycatransition *) catransitionwithtype :( nsstring *) type subtype :( nsstring *) subtype duration :( double) Duration timingfunction :( nsstring *) timingname;
@ End
# Import "mycatransition. H"
@ Implementation mycatransition
+ (Mycatransition *) catransitionwithtype :( nsstring *) type subtype :( nsstring *) subtype duration :( double) Duration timingfunction :( nsstring *) timingname {
// Transfer Animation
Mycatransition * animation = [mycatransition animation];
Animation. type = type;
Animation. Subtype = subtype;
Animation. Duration = duration;
Animation. timingfunction = [camediatimingfunction functionwithname: timingname];
Return animation;
}
@ End
Instance:
Adding a Custom Animation object to the layer that requires transition will achieve the cool animation effect.
Mycatransition * animation = [mycatransition catransitionwithtype: @ "push" subtype: @ "frombottom" Duration: 0.7 timingfunction: @ "easeineaseout"];
[Self. navigationcontroller. View. layer addanimation: animation forkey: @ "Animation"];
End
Custom transfer animation library