IOS Animation Type Notes

Source: Internet
Author: User

#pragma Mark Core Animation

-(ibaction) buttonPressed1: (ID) Sender {

UIButton *button = (UIButton *) sender;

nsinteger tag = button. tag;

catransition *animation = [catransitionanimation];

Animation. delegate = self;

Animation. Duration = Kduration;

Animation. timingfunction = Uiviewanimationcurveeaseinout;

Switch (tag) {

Case 101:

Animation. type = Kcatransitionfade;

break;

Case 102:

Animation. type = Kcatransitionpush;

break;

Case 103:

Animation. type = kcatransitionreveal;

break;

Case 104:

Animation. type = Kcatransitionmovein;

break;

Case 201:

Animation. type = @ "Cube";

break;

Case 202:

Animation. type = @ "Suckeffect";

break;

Case 203:

Animation. type = @ "Oglflip";

break;

Case 204:

Animation. type = @ "Rippleeffect";

break;

Case 205:

Animation. type = @ "Pagecurl";

break;

Case 206:

Animation. type = @ "Pageuncurl";

break;

Case 207:

Animation. type = @ "Camerairishollowopen";

break;

Case 208:

Animation. type = @ "Camerairishollowclose";

break;

default:

break;

}

Switch (self.) TypeID) {

Case 0:

Animation. Subtype = kcatransitionfromleft;

break;

Case 1:

Animation. Subtype = Kcatransitionfrombottom;

break;

Case 2:

Animation. Subtype = kcatransitionfromright;

break;

Case 3:

Animation. Subtype = kcatransitionfromtop;

break;

default:

break;

}

Self. TypeID + = 1;

if (self.) TypeID > 3) {

Self. TypeID = 0;

}

nsuinteger green = [self. View subviews] indexofobject:self. Greenview];

Nsuinteger blue = [self. View subviews] indexofobject:self. Blueview];

[self. Viewexchangesubviewatindex: Green withsubviewatindex: blue];

[Self. View Layer] addanimation: Animation forkey:@ "animation"];

}

#pragma mark UIView animation

-(ibaction) ButtonPressed2: (ID) Sender {

UIButton *button = (UIButton *) sender;

nsinteger tag = button. tag;

cgcontextref context = uigraphicsgetcurrentcontext();

[UIViewbeginanimations:Nilcontext: context];

[UIViewsetanimationcurve:uiviewanimationcurveeaseinout];

[UIViewsetanimationduration:kduration];

Switch (tag) {

Case :

[UIViewsetanimationtransition:uiviewanimationtransitioncurldownforview: /c24>self. ViewCache:YES];

break;

Case 106:

[UIViewsetanimationtransition:uiviewanimationtransitioncurlupforview:S Elf. ViewCache:YES];

break;

Case 107:

[UIViewsetanimationtransition:uiviewanimationtransitionflipfromleftforview : self . ViewCache : YES ];

break;

Case 108:

[UIViewsetanimationtransition:uiviewanimationtransitionflipfromrightforview: self. ViewCache:YES];

break;

default:

break;

}

nsuinteger green = [self. View subviews] indexofobject:self. Greenview];

Nsuinteger blue = [self. View subviews] indexofobject:self. Blueview];

[self. Viewexchangesubviewatindex: Green withsubviewatindex: blue];

[UIViewsetanimationdelegate:self];

// After the animation is complete call a method

//[uiview setanimationdidstopselector: @selector (animationfinished:)];

[UIViewcommitanimations];

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.