动画

#import "ChangeAnimationView.h"

```

@interface ChangeAnimationView ()

@property (strong,nonatomic) CAShapeLayer *topLineLayer;

@property (strong,nonatomic) CAShapeLayer *bottomLineLayer;

@property (strong,nonatomic) CAShapeLayer *changedLayer;

```

@end

//small

//static const CGFloat Raduis = 20;

//static const CGFloat lineWidth = 20.0f;

//static const CGFloat lineGapHeight = 5.0f;

//static const CGFloat lineHeight = 2.0f;

//big

static const CGFloat Raduis = 50.0f;

static const CGFloat lineWidth = 50.0f;

static const CGFloat lineGapHeight = 10.0f;

static const CGFloat lineHeight = 8.0f;

static const CGFloat kStep1Duration = 0.5;

static const CGFloat kStep2Duration = 0.5;

static const CGFloat kStep3Duration = 5.0;

static const CGFloat kStep4Duration = 5.0;

#define kTopY      Raduis - lineGapHeight

#define kCenterY    kTopY + lineGapHeight + lineHeight

#define kBottomY    kCenterY + lineGapHeight + lineHeight

#define Radians(x)  (M_PI * (x) / 180.0)

@implementation ChangeAnimationView

-(instancetype)initWithFrame:(CGRect)frame{

self = [super initWithFrame:frame];

if (self) {

self.frame = frame;

self.backgroundColor = [UIColor orangeColor];

}

return self;

}

-(void)startAnimation{

[_changedLayer removeAllAnimations];

[_changedLayer removeFromSuperlayer];

[_topLineLayer removeFromSuperlayer];

[_bottomLineLayer removeFromSuperlayer];

[self initLayers];

[self animationStep1];

}

-(void)resumeAnimation{

[self resumeLayer:_topLineLayer];

[self resumeLayer:_bottomLineLayer];

[self resumeLayer:_changedLayer];

}

-(void)stopAnimation{

[self pauseLayer:_topLineLayer];

[self pauseLayer:_bottomLineLayer];

[self pauseLayer:_changedLayer];

}

#pragma mark 初始化图形

-(void)initLayers

{

_topLineLayer = [CAShapeLayer layer];

_bottomLineLayer = [CAShapeLayer layer];

_changedLayer = [CAShapeLayer layer];

CALayer *Toplayer = [CALayer layer];

Toplayer.frame = CGRectMake((self.bounds.size.width + lineWidth)/2, kTopY, lineWidth, lineHeight);

[self.layer addSublayer:Toplayer];

CALayer *BottomLayer = [CALayer layer];

BottomLayer.frame = CGRectMake((self.bounds.size.width + lineWidth)/2, kBottomY, lineWidth, lineHeight);

[self.layer addSublayer:BottomLayer];

//    CALayer *centerLayer = [CALayer layer];

//    centerLayer.frame = CGRectMake((self.bounds.size.width + lineWidth)/2, kCenterY, lineWidth, lineHeight);

//    [self.layer addSublayer:centerLayer];

CGFloat startOriginX = self.center.x - lineWidth /2.0;

CGFloat endOriginX = self.center.x + lineWidth /2.0;

[_topLineLayer setStrokeColor:[[UIColor whiteColor] CGColor]];

_topLineLayer.contentsScale = [UIScreen mainScreen].scale;

_topLineLayer.lineWidth = lineHeight ;

_topLineLayer.lineCap = kCALineCapRound;

_topLineLayer.position = CGPointMake(0,0);

[_bottomLineLayer setStrokeColor:[[UIColor whiteColor] CGColor]];

_bottomLineLayer.contentsScale = [UIScreen mainScreen].scale;

_bottomLineLayer.lineWidth = lineHeight ;

_bottomLineLayer.lineCap = kCALineCapRound;

[_changedLayer setStrokeColor:[[UIColor whiteColor] CGColor]];

_changedLayer.fillColor = [UIColor clearColor].CGColor;

_changedLayer.contentsScale = [UIScreen mainScreen].scale;

_changedLayer.lineWidth = lineHeight ;

_changedLayer.lineCap = kCALineCapRound;

UIBezierPath *path = [UIBezierPath bezierPath];

[path moveToPoint:CGPointMake(0,0)];

[path addLineToPoint:CGPointMake(-lineWidth,0)];

_topLineLayer.path = path.CGPath;

CGMutablePathRef solidChangedLinePath =  CGPathCreateMutable();

//被改变的layer实线

CGPathMoveToPoint(solidChangedLinePath, NULL, startOriginX, kCenterY);

CGPathAddLineToPoint(solidChangedLinePath, NULL, endOriginX, kCenterY);

[_changedLayer setPath:solidChangedLinePath];

CGPathRelease(solidChangedLinePath);

//    [path moveToPoint:CGPointMake(0,0)];

//    [path addLineToPoint:CGPointMake(-lineWidth,0)];

//    _changedLayer.path = path.CGPath;

[path moveToPoint:CGPointMake(0,0)];

[path addLineToPoint:CGPointMake(-lineWidth,0)];

_bottomLineLayer.path = path.CGPath;

[Toplayer addSublayer:_topLineLayer];

[BottomLayer addSublayer:_bottomLineLayer];

[self.layer addSublayer:_changedLayer];

}

#pragma mark 本类内部方法,实现动画第三步和第二步

-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag

{

if ([[anim valueForKey:@"animationName"] isEqualToString:@"animationStep1"]) {

[self animationStep2];

}

else if([[anim valueForKey:@"animationName"] isEqualToString:@"animationStep2"]){

[_changedLayer removeFromSuperlayer];

[self animationStep3];

}

else if ([[anim valueForKey:@"animationName"] isEqualToString:@"animationStep3"]){

[self cancelAnimation];

}

else if ([[anim valueForKey:@"animationName"] isEqualToString:@"animationStep4"]){

_changedLayer.affineTransform = CGAffineTransformMakeTranslation(5, 0);

//平移x

CABasicAnimation *translationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];

translationAnimation.fromValue = [NSNumber numberWithFloat:0];

translationAnimation.toValue = [NSNumber numberWithFloat:5];

translationAnimation.duration = 0.5;

translationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

[_changedLayer addAnimation:translationAnimation forKey:nil];

}

}

/*---------------------------------------------------启动动画第一步-------------------------------------------*/

#pragma mark ----第一步,中间横实线的由右向左的运动效果。这其实是一个组合动画。是先向左偏移的同时横线变短。先看一下实现的动态效果。

- (void) animationStep1{

//最终changedLayer的状态

_changedLayer.strokeEnd = 0.1;

//基本动画,长度有1.0减少到0.4

CABasicAnimation *strokeAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];

strokeAnimation.fromValue = [NSNumber numberWithFloat:1.0f];

strokeAnimation.toValue = [NSNumber numberWithFloat:0.1f];

//基本动画,向左偏移10个像素

CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"position.x"];

pathAnimation.fromValue = [NSNumber numberWithFloat:0.0];

pathAnimation.toValue = [NSNumber numberWithFloat:-10];

//组合动画,平移和长度减少同时进行

CAAnimationGroup *animationGroup = [CAAnimationGroup animation];

animationGroup.animations = [NSArray arrayWithObjects:strokeAnimation,pathAnimation, nil];

animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];

animationGroup.duration = kStep1Duration;

//设置代理

animationGroup.delegate = self;

animationGroup.removedOnCompletion = YES;

//监听动画

[animationGroup setValue:@"animationStep1" forKey:@"animationName"];

//动画加入到changedLayer上

[_changedLayer addAnimation:animationGroup forKey:nil];}

/*---------------------------------------------------------------------------------------------------*/

/*---------------------------------------------------启动动画第二步-------------------------------------------*/

#pragma mark ----第二步,由左向右的动画--向右偏移同时横线长度变长。看一下Step2要实现的动画效果。其思路和Step1是一样的。

-(void)animationStep2

{

CABasicAnimation *translationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];

translationAnimation.fromValue = [NSNumber numberWithFloat:-10];

//strokeEnd:0.8 剩余的距离toValue = lineWidth * (1 - 0.8);

translationAnimation.toValue = [NSNumber numberWithFloat:0.2 * lineWidth ];

_changedLayer.strokeEnd = 0.8;

CABasicAnimation *strokeAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];

strokeAnimation.fromValue = [NSNumber numberWithFloat:0.4f];

strokeAnimation.toValue = [NSNumber numberWithFloat:0.8f];

CAAnimationGroup *animationGroup = [CAAnimationGroup animation];

animationGroup.animations = [NSArray arrayWithObjects:strokeAnimation,translationAnimation, nil];

animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

animationGroup.duration = kStep2Duration;

//设置代理

animationGroup.delegate = self;

animationGroup.removedOnCompletion = YES;

[animationGroup setValue:@"animationStep2" forKey:@"animationName"];

[_changedLayer addAnimation:animationGroup forKey:nil];

}

/*-----------------------------------------------------------------------------------------------------*/

/*---------------------------------------------------启动动画第三步-------------------------------------------*/

#pragma mark ----第三步,圆弧的动画效果和上下两个横实线的动画效果。

/*

* 整个path路径是由三部分组成,ABC曲线、CD圆弧、DD′圆。

* 使用UIBezierPath的方法

*/

-(void)animationStep3{

_changedLayer = [CAShapeLayer layer];

_changedLayer.fillColor = [UIColor clearColor].CGColor;

_changedLayer.strokeColor = [UIColor whiteColor].CGColor;

_changedLayer.contentsScale = [UIScreen mainScreen].scale;

_changedLayer.lineWidth = lineHeight ;

_changedLayer.lineCap = kCALineCapRound;

[self.layer addSublayer:_changedLayer];

UIBezierPath *path = [UIBezierPath bezierPath];

// 画贝塞尔曲线 圆弧

[path moveToPoint:CGPointMake(self.center.x +  lineWidth/2.0 , kCenterY)];

//30度,经过反复测试,效果最好

CGFloat angle = Radians(30);

CGFloat endPointX = self.center.x + Raduis * cos(angle);

CGFloat endPointY = kCenterY - Raduis * sin(angle);

CGFloat startPointX = self.center.x + lineWidth/2.0;

CGFloat startPointY = kCenterY;

CGFloat controlPointX = self.center.x + Raduis *acos(angle);

CGFloat controlPointY = kCenterY;

//三点曲线

[path addCurveToPoint:CGPointMake(endPointX, endPointY)

controlPoint1:CGPointMake(startPointX , startPointY)

controlPoint2:CGPointMake(controlPointX , controlPointY)];

//组合path 路径

UIBezierPath *path1 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.center.x,kCenterY)

radius:Raduis

startAngle:2 * M_PI - angle

endAngle:M_PI + angle

clockwise:NO];

[path appendPath:path1];

UIBezierPath *path2 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.center.x,kCenterY)

radius:Raduis

startAngle:M_PI *3/2 - (M_PI_2 -angle)

endAngle:-M_PI_2 - (M_PI_2 -angle)

clockwise:NO];

[path appendPath:path2];

_changedLayer.path = path.CGPath;

//平移量

CGFloat toValue = lineWidth *(1- cos(M_PI_4)) /2.0;

//finished 最终状态

CGAffineTransform transform1 = CGAffineTransformMakeRotation(-M_PI_4);

CGAffineTransform transform2 = CGAffineTransformMakeTranslation(-toValue, 0);

CGAffineTransform transform3 = CGAffineTransformMakeRotation(M_PI_4);

CGAffineTransform transform = CGAffineTransformConcat(transform1, transform2);

_topLineLayer.affineTransform = transform;

transform = CGAffineTransformConcat(transform3, transform2);

_bottomLineLayer.affineTransform = transform;

CGFloat orignPercent = [self calculateCurveLength] / [self calculateTotalLength];

CGFloat endPercent =([self calculateCurveLength] + Radians(120) *Raduis ) / [self calculateTotalLength];

_changedLayer.strokeStart = endPercent;

CAKeyframeAnimation *startAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeStart"];

startAnimation.values = @[@0.0,@(endPercent)];

CAKeyframeAnimation *EndAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeEnd"];

EndAnimation.values = @[@(orignPercent),@1.0];

CAAnimationGroup *animationGroup = [CAAnimationGroup animation];

animationGroup.animations = [NSArray arrayWithObjects:startAnimation,EndAnimation, nil];

animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

animationGroup.duration = kStep3Duration;

animationGroup.delegate = self;

animationGroup.removedOnCompletion = YES;

[animationGroup setValue:@"animationStep3" forKey:@"animationName"];

[_changedLayer addAnimation:animationGroup forKey:nil];

//平移x

CABasicAnimation *translationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];

translationAnimation.fromValue = [NSNumber numberWithFloat:0];

translationAnimation.toValue = [NSNumber numberWithFloat:-toValue];

//角度关键帧 上横线的关键帧 0 - 10° - (-55°) - (-45°)

CAKeyframeAnimation *rotationAnimation1 = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];

rotationAnimation1.values = @[[NSNumber numberWithFloat:0],

[NSNumber numberWithFloat:Radians(10) ],

[NSNumber numberWithFloat:Radians(-10) - M_PI_4 ],

[NSNumber numberWithFloat:- M_PI_4 ]

];

CAAnimationGroup *transformGroup1 = [CAAnimationGroup animation];

transformGroup1.animations = [NSArray arrayWithObjects:rotationAnimation1,translationAnimation, nil];

transformGroup1.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

transformGroup1.duration = kStep3Duration;

transformGroup1.removedOnCompletion = YES;

[_topLineLayer addAnimation:transformGroup1 forKey:nil];

//角度关键帧 下横线的关键帧 0 - (-10°) - (55°) - (45°)

CAKeyframeAnimation *rotationAnimation2 = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];

rotationAnimation2.values = @[[NSNumber numberWithFloat:0],

[NSNumber numberWithFloat:Radians(-10) ],

[NSNumber numberWithFloat:Radians(10) + M_PI_4 ],

[NSNumber numberWithFloat: M_PI_4 ]

];

CAAnimationGroup *transformGroup2 = [CAAnimationGroup animation];

transformGroup2.animations = [NSArray arrayWithObjects:rotationAnimation2,translationAnimation, nil];

transformGroup2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

transformGroup2.duration = kStep3Duration ;

transformGroup2.delegate = self;

transformGroup2.removedOnCompletion = YES;

[_bottomLineLayer addAnimation:transformGroup2 forKey:nil];

}

/*-------------------------------------------------------------------------------------------------------------------*/

#pragma mark ----第四步,取消动画

-(void)cancelAnimation

{

//最关键是path路径

UIBezierPath *path = [UIBezierPath bezierPath];

//30度,经过反复测试,效果最好

CGFloat angle = Radians(30);

CGFloat startPointX = self.center.x + Raduis * cos(angle);

CGFloat startPointY = kCenterY - Raduis * sin(angle);

CGFloat controlPointX = self.center.x + Raduis *acos(angle);

CGFloat controlPointY = kCenterY;

CGFloat endPointX = self.center.x + lineWidth /2;

CGFloat endPointY = kCenterY;

//组合path 路径 起点 -150° 顺时针的圆

path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.center.x,kCenterY)

radius:Raduis

startAngle:-M_PI + angle

endAngle:M_PI + angle

clockwise:YES];

//起点为 180°-> (360°-30°)

UIBezierPath *path1 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.center.x,kCenterY)

radius:Raduis

startAngle:M_PI + angle

endAngle:2 * M_PI - angle

clockwise:YES];

[path appendPath:path1];

//三点曲线

UIBezierPath *path2 = [UIBezierPath bezierPath];

[path2 moveToPoint:CGPointMake(startPointX, startPointY)];

[path2 addCurveToPoint:CGPointMake(endPointX,endPointY)

controlPoint1:CGPointMake(startPointX, startPointY)

controlPoint2:CGPointMake(controlPointX, controlPointY)];

[path appendPath:path2];

//比原始状态向左偏移5个像素

UIBezierPath *path3 = [UIBezierPath bezierPath];

[path3 moveToPoint:CGPointMake(endPointX,endPointY)];

[path3 addLineToPoint:CGPointMake(self.center.x - lineWidth/2 -5,endPointY)];

[path appendPath:path3];

_changedLayer.path = path.CGPath;

//平移量

CGFloat toValue = lineWidth *(1- cos(M_PI_4)) /2.0;

//finished 最终状态

CGAffineTransform transform1 = CGAffineTransformMakeRotation(0);

CGAffineTransform transform2 = CGAffineTransformMakeTranslation(0, 0);

CGAffineTransform transform3 = CGAffineTransformMakeRotation(0);

CGAffineTransform transform = CGAffineTransformConcat(transform1, transform2);

_topLineLayer.affineTransform = transform;

transform = CGAffineTransformConcat(transform3, transform2);

_bottomLineLayer.affineTransform = transform;

//一个圆的长度比

CGFloat endPercent = 2* M_PI *Raduis / ([self calculateTotalLength] + lineWidth);

//横线占总path的长度比

CGFloat percent = lineWidth / ([self calculateTotalLength] + lineWidth);

_changedLayer.strokeStart = 1.0 -percent;

CAKeyframeAnimation *startAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeStart"];

startAnimation.values = @[@0.0,@0.3,@(1.0 -percent)];

//在π+ angle

CAKeyframeAnimation *EndAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeEnd"];

EndAnimation.values = @[@(endPercent),@(endPercent),@1.0];

CAAnimationGroup *animationGroup = [CAAnimationGroup animation];

animationGroup.animations = [NSArray arrayWithObjects:startAnimation,EndAnimation, nil];

animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

animationGroup.duration = kStep4Duration;

animationGroup.delegate = self;

animationGroup.removedOnCompletion = YES;

[animationGroup setValue:@"animationStep4" forKey:@"animationName"];

[_changedLayer addAnimation:animationGroup forKey:nil];

//平移x

CABasicAnimation *translationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];

translationAnimation.fromValue = [NSNumber numberWithFloat:-toValue];

translationAnimation.toValue = [NSNumber numberWithFloat:0];

//角度关键帧 上横线的关键帧  (-45°) -> (-55°)-> 10° -> 0

CAKeyframeAnimation *rotationAnimation1 = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];

rotationAnimation1.values = @[[NSNumber numberWithFloat:- M_PI_4 ],

[NSNumber numberWithFloat:- Radians(10) - M_PI_4 ],

[NSNumber numberWithFloat:Radians(10) ],

[NSNumber numberWithFloat:0]

];

CAAnimationGroup *transformGroup1 = [CAAnimationGroup animation];

transformGroup1.animations = [NSArray arrayWithObjects:rotationAnimation1,translationAnimation, nil];

transformGroup1.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

transformGroup1.duration = kStep4Duration;

transformGroup1.removedOnCompletion = YES;

[_topLineLayer addAnimation:transformGroup1 forKey:nil];

//角度关键帧 下横线的关键帧  (45°)-> (55°)- >(-10°)-> 0

CAKeyframeAnimation *rotationAnimation2 = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];

rotationAnimation2.values = @[[NSNumber numberWithFloat: M_PI_4 ],

[NSNumber numberWithFloat:Radians(10) + M_PI_4 ],

[NSNumber numberWithFloat:-Radians(10) ],

[NSNumber numberWithFloat:0]

];

CAAnimationGroup *transformGroup2 = [CAAnimationGroup animation];

transformGroup2.animations = [NSArray arrayWithObjects:rotationAnimation2,translationAnimation, nil];

transformGroup2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

transformGroup2.duration = kStep4Duration;

transformGroup2.delegate = self;

transformGroup2.removedOnCompletion = YES;

[_bottomLineLayer addAnimation:transformGroup2 forKey:nil];

}

#pragma mark 停止动画

//停止

-(void)pauseLayer:(CALayer*)layer

{

CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];

layer.speed = 0.0;

layer.timeOffset = pausedTime;

}

#pragma mark 恢复动画

//恢复

-(void)resumeLayer:(CALayer*)layer

{

CFTimeInterval pausedTime = [layer timeOffset];

layer.speed = 1.0;

layer.timeOffset = 0.0;

layer.beginTime = 0.0;

CFTimeInterval timeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;

layer.beginTime = timeSincePause;

}

/*----------------------------- 一些基本数据的计算,曲线长度,贝塞尔曲线长度 ----------------------------------------*/

#pragma mark 一些基本数据的计算,曲线长度,贝塞尔曲线长度

//第一,计算总长度

-(CGFloat)calculateTotalLength

{

CGFloat curveLength = [self calculateCurveLength];

//一个圆 + 120度弧长的 总长度

CGFloat length = (Radians(120) + 2 * M_PI) * Raduis;

CGFloat totalLength = curveLength + length;

return totalLength;

}

//二,计算曲线的长度

-(CGFloat)calculateCurveLength{

CGFloat angle = Radians(30);

CGFloat endPointX = self.center.x + Raduis * cos(angle);

CGFloat endPointY = kCenterY - Raduis * sin(angle);

CGFloat startPointX = self.center.x + lineWidth/2.0;

CGFloat startPointY = kCenterY;

CGFloat controlPointX = self.center.x + Raduis *acos(angle);

CGFloat controlPointY = kCenterY;

CGFloat curveLength = [self bezierCurveLengthFromStartPoint:CGPointMake(startPointX, startPointY)

toEndPoint:CGPointMake(endPointX,endPointY)

withControlPoint:CGPointMake(controlPointX, controlPointY)];

return curveLength;

}

//三,求贝塞尔曲线长度

-(CGFloat) bezierCurveLengthFromStartPoint:(CGPoint)start toEndPoint:(CGPoint) end withControlPoint:(CGPoint) control

{

const int kSubdivisions = 50;

const float step = 1.0f/(float)kSubdivisions;

float totalLength = 0.0f;

CGPoint prevPoint = start;

// starting from i = 1, since for i = 0 calulated point is equal to start point

for (int i = 1; i <= kSubdivisions; i++)

{

float t = i*step;

float x = (1.0 - t)*(1.0 - t)*start.x + 2.0*(1.0 - t)*t*control.x + t*t*end.x;

float y = (1.0 - t)*(1.0 - t)*start.y + 2.0*(1.0 - t)*t*control.y + t*t*end.y;

CGPoint diff = CGPointMake(x - prevPoint.x, y - prevPoint.y);

totalLength += sqrtf(diff.x*diff.x + diff.y*diff.y); // Pythagorean

prevPoint = CGPointMake(x, y);

}

return totalLength;

}

/*-----------------------------------------------------------------------------------------------------------------------------*/

-(void)dealloc

{

NSLog(@"dealloc");

}

@end

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,456评论 5 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,370评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,337评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,583评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,596评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,572评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,936评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,595评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,850评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,601评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,685评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,371评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,951评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,934评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,167评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,636评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,411评论 2 342

推荐阅读更多精彩内容