iOS 动画 波纹 水波 声波 海水

YSCAnimation

Github地址 :https://github.com/xiaochaofeiyu/YSCAnimation

对你有帮助的话帮我点颗星星哦!

ripple animation

1). singlelineripple --> corresponding class YSCRippleView

[_rippleView showWithRippleType:YSCRippleTypeLine]

2). ringRipple --> corresponding class YSCRippleView

[_rippleView showWithRippleType:YSCRippleTypeRing]

3). cicleRipple --> corresponding class YSCRippleView

[_rippleView showWithRippleType:YSCRippleTypeCircle]

4). mixedripple --> corresponding class YSCRippleView

[_rippleView showWithRippleType:YSCRippleTypeMixed]

wave animation

1). pusle --> corresponding class YSCWaveView

[_waveView showWaveViewWithType:YSCWaveTypePulse]

2). wave --> corresponding class YSCWaveView

[_waveView showWaveViewWithType:YSCWaveTypeVoice]

3). movedWave --> corresponding class YSCWaveView

[_waveView showWaveViewWithType:YSCWaveTypeMovedVoice]

mask animation

1). circleLoad --> corresponding class YSCCircleLoadAnimationView

YSCCircleLoadAnimationView *shapeView = [[YSCCircleLoadAnimationView alloc] initWithFrame:self.view.bounds];UIImage*image = [UIImageimageNamed:@"tree.jpg"];shapeView.loadingImage.image= image;[self.viewaddSubview:shapeView];[shapeView startLoading];

2). microphone wave --> corresponding class YSCMicrophoneWaveView

YSCMicrophoneWaveView*microphoneWaveView = [[YSCMicrophoneWaveViewalloc]init];[microphoneWaveView showMicrophoneWaveInParentView:self.view withFrame:self.view.bounds];

3). fanshaped wave --> corresponding class YSCFanShapedView

- (YSCFanShapedView*)fanshapedView{if(!_fanshapedView) {self.fanshapedView= [[YSCFanShapedViewalloc] init];        _fanshapedView.frame=CGRectMake(0,0,300,150);        _fanshapedView.center=CGPointMake(self.view.bounds.size.width/2.0,self.view.bounds.size.height/2.0-100);            }return_fanshapedView;}//show[self.fanshapedViewshowInParentView:self.viewWithType:YSCFanShapedShowTypeExpand];

voice wave

1). voice wave --> corresponding class YSCVoiceWaveView YSCVoiceLoadingCircleView

//showself.voiceWaveView = [[YSCVoiceWaveViewalloc]init];[self.voiceWaveView showInParentView:self.voiceWaveParentView];[self.voiceWaveView startVoiceWave];//hide[self.voiceWaveView stopVoiceWaveWithShowLoadingViewCallback:^{            [self.updateVolumeTimer invalidate];            _updateVolumeTimer =nil;            [self.loadingView startLoadingInParentView:self.view];        }];

water wave

1). water wave --> corresponding class YSCWaterWaveView

- (YSCWaterWaveView *)waterWave{if(!_waterWave) {        self.waterWave = [[YSCWaterWaveView alloc] init];        _waterWave.frame = CGRectMake(0,0, self.view.bounds.size.width,300);        _waterWave.percent =0.6;        _waterWave.firstWaveColor = [UIColor colorWithRed:146/255.0green:148/255.0blue:216/255.0alpha:1.0];        _waterWave.secondWaveColor = [UIColor colorWithRed:84/255.0green:87/255.0blue:197/255.0alpha:1.0];    }return_waterWave;}//show[self.view addSubview:self.waterWave];[self.waterWave startWave];

seawater wave

1). seawater wave --> corresponding class YSCSeaGLView

tip: it should not run in simulator

self.seaGLView= [[YSCSeaGLView alloc] initWithFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height)];[self.viewaddSubview:_seaGLView];//hide- (void)viewDidDisappear:(BOOL)animated{    [_seaGLView removeFromParent];    _seaGLView =nil;}

emitter animation

1). fire --> corresponding class YSCFireViewController

- (void)viewDidLoad{    [superviewDidLoad];// Do any additional setup after loading the view, typically from a nib.self.view.backgroundColor=[UIColorwhiteColor];//设置发射器_fireEmitter=[[CAEmitterLayeralloc] init];    _fireEmitter.emitterPosition=CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height-20);    _fireEmitter.emitterSize=CGSizeMake(self.view.frame.size.width-100,20);    _fireEmitter.renderMode= kCAEmitterLayerAdditive;//发射单元//火焰CAEmitterCell*fire = [CAEmitterCellemitterCell];    fire.birthRate=800;    fire.lifetime=2.0;    fire.lifetimeRange=1.5;    fire.color=[[UIColorcolorWithRed:0.8green:0.4blue:0.2alpha:0.1]CGColor];    fire.contents=(id)[[UIImageimageNamed:@"fire"]CGImage];    [fire setName:@"fire"];    fire.velocity=160;    fire.velocityRange=80;    fire.emissionLongitude=M_PI+M_PI_2;    fire.emissionRange=M_PI_2;    fire.scaleSpeed=0.3;    fire.spin=0.2;    fire.alphaSpeed= -0.05;//烟雾CAEmitterCell*smoke = [CAEmitterCellemitterCell];    smoke.birthRate=400;    smoke.lifetime=3.0;    smoke.lifetimeRange=1.5;    smoke.color=[[UIColorcolorWithRed:1green:1blue:1alpha:0.05]CGColor];    smoke.contents=(id)[[UIImageimageNamed:@"fire"]CGImage];    [smoke setName:@"smoke"];    smoke.velocity=250;    smoke.velocityRange=100;    smoke.emissionLongitude=M_PI+M_PI_2;    smoke.emissionRange=M_PI_2;    smoke.alphaSpeed= -0.05;    _fireEmitter.emitterCells=[NSArrayarrayWithObjects:smoke, fire,nil];    [self.view.layeraddSublayer:_fireEmitter];}

2). butterfly --> corresponding class YSCButterflyViewController

- (void)viewDidLoad{    [superviewDidLoad];// Do any additional setup after loading the view, typically from a nib.self.view.backgroundColor=[UIColorwhiteColor];//emitter_butterflyEmitter=[[CAEmitterLayeralloc] init];    _butterflyEmitter.emitterPosition=CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height-20);    _butterflyEmitter.emitterSize=CGSizeMake(self.view.frame.size.width-100,20);    _butterflyEmitter.renderMode= kCAEmitterLayerUnordered;    _butterflyEmitter.emitterShape= kCAEmitterLayerCuboid;    _butterflyEmitter.emitterDepth=10;    _butterflyEmitter.preservesDepth=YES;//cells//blue butterflyCAEmitterCell*blueButterfly = [CAEmitterCellemitterCell];    blueButterfly.birthRate=8;    blueButterfly.lifetime=5.0;    blueButterfly.lifetimeRange=1.5;    blueButterfly.color=[[UIColorcolorWithRed:1.0green:1.0blue:1.0alpha:0.1]CGColor];    blueButterfly.contents=(id)[[UIImageimageNamed:@"butterfly1"]CGImage];    [blueButterfly setName:@"blueButterfly"];    blueButterfly.velocity=160;    blueButterfly.velocityRange=80;    blueButterfly.emissionLongitude=M_PI+M_PI_2;    blueButterfly.emissionLatitude= M_PI+M_PI_2;    blueButterfly.emissionRange=M_PI_2;    blueButterfly.scaleSpeed=0.3;    blueButterfly.spin=0.2;    blueButterfly.alphaSpeed=0.2;//yellow butterflyCAEmitterCell*yellowButterfly = [CAEmitterCellemitterCell];    yellowButterfly.birthRate=4;    yellowButterfly.lifetime=5.0;    yellowButterfly.lifetimeRange=1.5;    yellowButterfly.color=[[UIColorcolorWithRed:1green:1blue:1alpha:0.05]CGColor];    yellowButterfly.contents=(id)[[UIImageimageNamed:@"butterfly2"]CGImage];    [yellowButterfly setName:@"yellowButterfly"];    yellowButterfly.velocity=250;    yellowButterfly.velocityRange=100;    yellowButterfly.emissionLongitude=M_PI+M_PI_2;    yellowButterfly.emissionLatitude= M_PI+M_PI_2;    yellowButterfly.emissionRange=M_PI_2;    yellowButterfly.alphaSpeed=0.2;    yellowButterfly.scaleSpeed=0.3;    yellowButterfly.spin=0.2;    _butterflyEmitter.emitterCells=[NSArrayarrayWithObjects:yellowButterfly, blueButterfly,nil];    [self.view.layeraddSublayer:_butterflyEmitter];}

repicator animation

1). matrixCircle --> corresponding class YSCMatrixCircleAnimationView

self.matrixCircleView = [[YSCMatrixCircleAnimationView alloc] initWithFrame:CGRectMake(0,0,300,300) xNum:8yNum:8];    _matrixCircleView.center = CGPointMake(self.view.bounds.size.width /2.0, self.view.bounds.size.height /2.0);[self.view addSubview:_matrixCircleView];

2). circle ripple --> corresponding class YSCCircleRippleView

self.rippleView= [[YSCCircleRippleView alloc] initWithFrame:CGRectMake(0,0,300,300)];_rippleView.center=CGPointMake(self.view.bounds.size.width/2.0,self.view.bounds.size.height/2.0);[self.viewaddSubview:_rippleView];_rippleView.backgroundColor= [[UIColorgreenColor] colorWithAlphaComponent:0.4];[_rippleView startAnimation];

Demo下载地址 :https://github.com/xiaochaofeiyu/YSCAnimation

文/小超飞鱼(简书作者)

原文链接:http://www.jianshu.com/p/464c740b9034

著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

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

推荐阅读更多精彩内容