There CoreAnimation under the framework of iOS special layer, they tend to make use of very dazzling animation effects without the use of pictures, unwanted frame animation. Here we take a look at three common layer animations are CAReplicatorLayer, CAEmitterLayer and CAGradientLayer.
First, copy the layer animation CAReplicatorLayer
CAReplicatorLayer layer can replicate their own sub-layer, and the copy of the original out of the sub-layer and the movable layer have the same effect. Then set some properties, you can complete the cool effects, it is very powerful. .
## Effect 1:
## Implementation: 1. First we have to get a love path, this path with UIBezierPath to make;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
+ (CGPathRef)heartPath
{
CGFloat W = 25;
CGFloat marginX = 10;
CGFloat marginY = 15/25.0 * W;
CGFloat space = 5/25.0 * W;
UIBezierPath *bezierPath = [UIBezierPath new];
[bezierPath moveToPoint:(CGPointMake(marginX + W * 2, W * 4 + space))];
[bezierPath addQuadCurveToPoint:CGPointMake(marginX, W * 2) controlPoint:CGPointMake(W, W * 4 - space)];
[bezierPath addCurveToPoint:CGPointMake(marginX + W * 2, W * 2) controlPoint1:CGPointMake(marginX, marginY) controlPoint2:CGPointMake(marginX + W * 2, marginY)];
[bezierPath addCurveToPoint:CGPointMake(marginX + W * 4, W * 2) controlPoint1:CGPointMake(marginX + W * 2, marginY) controlPoint2:CGPointMake(marginX + W * 4, marginY)];
[bezierPath addQuadCurveToPoint:CGPointMake(marginX + W * 2, W * 4 + space) controlPoint:CGPointMake(marginX * 2 + W * 3, W * 4 - space)];
[bezierPath closePath];
CGAffineTransform T = CGAffineTransformMakeScale(3.0, 3.0);
iOS animation is very powerful, I still have a lot to learn to be. In addition, very good place to write, I hope that Great God can correct me, I will try to modify, thank you.