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