swift--animation effects

Source: Internet
Author: User

The For loop creates a 4*4 view and then animates all the view of the opposite side, where the effect of the animation is set:

1, rotate Animation

         forTileinchbackgrounds{//Digital Block size is now the 1/10 of the original size of the positionTile.layer.setAffineTransform (Cgaffinetransform (ScaleX:0.1Y:0.1))                        //Animate , Animation duration 1 secondsUiview.animate (withduration:1, Delay:0.01, Options: [], animations: {}, Completion: {(finished)inchuiview.animate (withduration:1, animations: {//when the animation is complete, the digital block revertstile.layer.setAffineTransform (cgaffinetransform.identity)}) })                    }

2, opaque to transparent effect

         for inch Backgrounds {                        0                        // animate , animation duration 1 sec.            10.01 , Options: [. curveeaseinout], animations: {                                            in1, Animations: {                     1})}            )                    }

3, from small to large effect

         forTileinchBackgrounds {//now the 1/10 of the original size before the digital fast sizeTile.layer.setAffineTransform (Cgaffinetransform (ScaleX:0.1Y:0.1))                        //Animate , Animation duration 1 secondsUiview.animate (withduration:1, Delay:0.01, Options: [], animations: {Tile.layer.setAffineTransform (Cgaffinetransform (ScaleX:1Y:1)}, Completion: {(finished)inchuiview.animate (withduration:0.08, animations: {Tile.layer.setAffineTransform (cgaffinetransform.identity)}) })                    }

Record three animation effects

swift--animation effects

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.