iOS development--animated programming Swift & (iii) catransition animation

Source: Internet
Author: User

Catransition Animation

1     //MARK:-catransition animation2     3 /// * Animated style * /4 //Let kcatransitionfade:nsstring! //page5 //Let kcatransitionmovein:nsstring! //Popup6 //Let kcatransitionpush:nsstring! //Launch7 //Let kcatransitionreveal:nsstring! //Move out8 //    9 /// * Direction of animation execution * /Ten //Let kcatransitionfromright:nsstring! //Right One //Let kcatransitionfromleft:nsstring! //made A //Let kcatransitionfromtop:nsstring! //Upper - //Let kcatransitionfrombottom:nsstring! //Bottom -      the     /*non-public animation effects*/ - //"Cube"//Cube - //"Suckeffect"//absorbed - //"Oglflip"//Flip + //"Rippleeffect"//Ripple - //"Pagecurl"//Volume page + //"Cameralrishollowopen"//Lens Open A //"Cameralrishollowclose"//Lens off at      -     //catransition Animation-Uncover (push animation) - @IBAction func caAnimationChage1 () -     { -var transition =catransition () -Transition.duration =1.0 inTransition.type = Kcatransitionpush//Push Type -Transition.subtype = Kcatransitionfromleft//from the left toSelf.view.exchangeSubviewAtIndex (1, Withsubviewatindex:0) + self.view.layer.addAnimation (Transition, Forkey:nil) -          the     } *      $     //catransition Animation-LaunchPanax Notoginseng @IBAction func caAnimationChage2 () -     { thevar transition =catransition () +Transition.duration =1.0 ATransition.type =Kcatransitionmovein theTransition.subtype =Kcatransitionfromtop +Self.view.exchangeSubviewAtIndex (0, Withsubviewatindex:1) - self.view.layer.addAnimation (Transition, Forkey:nil) $     } $      -      -     //catransition Animation-panning the @IBAction func catranatate () -     {Wuyi         //every time it's a former position pan theSelf.testimageview.transform=cgaffinetransformtranslate (Self.testImageView.transform,-1.9, -1.9)//direction of positive or negative representation -  Wu         //The translation is calculated from the first position each time - //self.testimageview.transform=cgaffinetransformmaketranslation (1.2, 1.2) About     } $      -     //catransition Animation-Rotate - @IBAction func carotate () -     { A         //Continuous Rotation + uiview.beginanimations (Nil, Context:nil) theUiview.setanimationduration (2.0)//Set Animation time -Self.testimageview.transform=cgaffinetransformrotate (Self.testImageView.transform, CGFloat (-m_pi/2)) $ uiview.commitanimations () the          the         //independent rotation, rotated at the initial position the //self.testimageview.transform=cgaffinetransformmakerotation (CGFloat (M_PI/6)) the     } -      in     //catransition Animations-zooming the @IBAction func cascale () the     { About          the         //Continuous Scaling the uiview.beginanimations (Nil, Context:nil) theUiview.setanimationduration (2.0)//Set Animation time +Self.testimageview.transform=cgaffinetransformscale (Self.testImageView.transform,1.5,1.5);//below 1.0 zoom out, 1.0 or larger - uiview.commitanimations () the         Bayi         //Scale independently, scaling at the initial position the //Self.testimageview.transform=cgaffinetransformmakescale (1.2, 1.2) the  -     } -      the     //catransition Animation-Invert to a State the @IBAction func cainvert () the     { theself.testimageview.transform=cgaffinetransformidentity;//return to initial state -          the         //Continuous Inversion the uiview.beginanimations (Nil, Context:nil) theUiview.setanimationduration (2.0)//Set Animation time94self.testimageview.transform=Cgaffinetransformconcat (Self.testimageview.transform,cgaffinetransforminvert (self.testImageView.transform )); the uiview.commitanimations () the          the         //independent inversion with initial position reversal98 //Self.testimageview.transform=cgaffinetransforminvert (self.testImageView.transform) About}

iOS development--animated programming Swift & (iii) catransition animation

Related Article

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.