Calaye's Animation
Creating Calayer Animations
Cabasicanimation *animation=[cabasicanimation animationwithkeypath:@ "Bounds.size"];
Set Initial Size
[Animation Setfromvalue:[nsvalue Valuewithcgsize:cgsizemake (1.0, 1.0)];
Set up a post-run method
[Animation Settovalue:[nsvalue valueWithCGSize:manImageView.bounds.size];
Settings are often
[Animation setduration:1.2];
Set up sub-agent monitoring
[Animation setdelegate:self];
[Manimageview.layer addanimation:animation forkey:@ "Image-bounds.size"];
Floating animations
Cakeyframeanimation *animation=[cakeyframeanimation animationwithkeypath:@ "position"];
Set the trajectory of the view action
Nsarray *values=[nsarray arraywithobjects:[nsvalue Valuewithcgpoint:cgpointmake (fx,fy)],
[Nsvalue Valuewithcgpoint:cgpointmake (FX1, FY1)],
[Nsvalue Valuewithcgpoint:cgpointmake (FX2, fy2)],
[Nsvalue Valuewithcgpoint:cgpointmake (FX3, fy3)],
[Nsvalue Valuewithcgpoint:cgpointmake (FX4, FY4)],nil];
Get points
[Animation setvalues:values];
Settings are often
[Animation setduration:5.0];
Set up agent snooping
[Animation setdelegate:self];
[Manimageview.layer addanimation:animation forkey:@ "Img-position"];
Animation of gradients
Cabasicanimation * animation=[cabasicanimation animationwithkeypath:@ "opacity"];
Set the minimum transparency value
[Animation Setfromvalue:[nsnumber numberwithfloat:1.0];
Set the maximum transparency value
[Animation Settovalue:[nsnumber numberwithint:0.0];
Playback rate
[Animation setduration:3.0];
Number of plays
[Animation setrepeatcount:3.0];
Setting up a monitoring agent
[Animation setdelegate:self];
[Animation setautoreverses:yes];//default is no, that is, restore immediately after transparent, yes is delayed recovery
[Manimageview.layer addanimation:animation forkey:@ "img-opacity"];
Animation of the Cube
Catransition *animation = [catransition animation];
Animation name
Animation.type [email protected] "cube";
Flip direction
Animation.subtype = Kcatransitionfromleft;
Duration
[Animation Setduration:2];
Proxy method
[Animation setdelegate:self];
The last animation does not remove, the default is yes remove
Animation.removedoncompletion = NO;
[_bview.layer addanimation:animation forkey:@ "Docube"];
Water Ripple Animation
Catransition *animation = [catransition animation];
Animation.type [email protected] "rippleeffect";
[Animation Setduration:2];
[Animation setrepeatcount:1.0];
[_bview.layer addanimation:animation forkey:@ "s Rippleeffect"];
Shrinkage effect
Catransition *animation = [catransition animation];
Animation.type [email protected] "suckeffect";
[Animation Setduration:2];
[Animation setrepeatcount:1.0];
[_bview.layer addanimation:animation forkey:@ "s Suckeffect"];
Flip Animation backwards
Catransition *animation = [catransition animation];
Animation.type [email protected] "oglflip";
[Animation Setduration:2];
[Animation setrepeatcount:1.0];
[_bview.layer addanimation:animation forkey:@ "s Oglflip"];
Page Up the animation
Catransition *animation = [catransition animation];
Animation.type [email protected] "Pagecurl";
[Animation Setduration:2];
[Animation setrepeatcount:1.0];
[_bview.layer addanimation:animation forkey:@ "s Pagecurl"];
Animation with the opposite effect on the top
Catransition *animation = [catransition animation];
Animation.type [email protected] "Pageuncurl";
[Animation Setduration:2];
[Animation setrepeatcount:1.0];
[_bview.layer addanimation:animation forkey:@ "s Pageuncurl"];
These animation effects are the same as the above
New view overrides old view
Movein
Old view moved out to reveal new view
Reveal
New view launches the old view
Push
Cube scroll up
Alignedcube
Camera animations
Camerairis
Camera Open Effect
Camerairishollowopen
Camera off effect
Camerairishollowclose
* Transition Direction
Fromright;
Fromleft;
Fromtop;
Frombottom;
Animation of iOS Learning summary