A category of NSTimer for showing 3D Fluttered animation for iOS, which is used very simply. Lightweight CALayer animation, core animation, 3D transform, performance safety.
// Snow
[NSTimer timerWithSnowAnimationInView:self.view backgroundImage:[UIImage imageNamed:@"snow_bg"] snowImage:[UIImage imageNamed:@"snow"] BGMFilePath:[[NSBundle mainBundle] pathForResource:@"snow_bgm" ofType:@"mp3"]]
// Falling flower:
[NSTimer timerWithSnowAnimationInView:self.view backgroundImage:[UIImage imageNamed:@"flower_bg"] snowImage:[UIImage imageNamed:@"flower"] BGMFilePath:[[NSBundle mainBundle] pathForResource:@"flower_bgm" ofType:@"mp3"]];
[NSTimer removeSnowAnimation];
- Add
pod 'XYFSnowAnimation'
to your Podfile. - Run
pod install
orpod update
. - Import <NSTimer+XYFSnowAnimation.h>.
- Download XYFSnowAnimation and find XYFSnowAnimationDemo/XYFSnowAnimation finder.
- Add the source files to your Xcode project.
- Import
NSTimer+XYFSnowAnimation.h
.
This library requires iOS 8.0+
.
XYFSnowAnimation is provided under the MIT license. See LICENSE file for details.
iOS 3D三维飘落下雪落花动画,轻量级CALayer图层动画,核心动画,3D形变,性能安全,定时器NSTimer分类,直接使用,很简单 。
// 下雪
[NSTimer timerWithSnowAnimationInView:self.view backgroundImage:[UIImage imageNamed:@"snow_bg"] snowImage:[UIImage imageNamed:@"snow"] BGMFilePath:[[NSBundle mainBundle] pathForResource:@"snow_bgm" ofType:@"mp3"]]
// 落花:
[NSTimer timerWithSnowAnimationInView:self.view backgroundImage:[UIImage imageNamed:@"flower_bg"] snowImage:[UIImage imageNamed:@"flower"] BGMFilePath:[[NSBundle mainBundle] pathForResource:@"flower_bgm" ofType:@"mp3"]];
[NSTimer removeSnowAnimation];
- 在 Podfile 中添加
pod 'XYFSnowAnimation'
。 - 执行
pod install
或pod update
。 - 导入 <NSTimer+XYFSnowAnimation.h>。
- 下载 XYFSnowAnimation 并找到 XYFSnowAnimationDemo/XYFSnowAnimation 文件夹。
- 将 XYFSnowAnimation 文件夹内的源文件添加(拖放)到你的工程。
- 导入
NSTimer+XYFSnowAnimation.h
。
该工具最低支持 iOS 8.0
。
XYFSnowAnimation 使用 MIT 许可证,详情见 LICENSE 文件。
Tip(提示):It may need to load for a while to show dynamic effect.可能需要加载一会才能看到动态效果。
QQ:2016003298
微信(WeChat):yz33915958