XYFSnowAnimation
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.
Usage
Add snow(Falling flower) animation
// 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"]];
remove snow(Falling flower) animation
[NSTimer removeSnowAnimation];
Installation
CocoaPods
- Add
pod 'XYFSnowAnimation'
to your Podfile. - Run
pod install
orpod update
. - Import <NSTimer+XYFSnowAnimation.h>.
Manually
- Download XYFSnowAnimation and find XYFSnowAnimationDemo/XYFSnowAnimation finder.
- Add the source files to your Xcode project.
- Import
NSTimer+XYFSnowAnimation.h
.
Requirements
This library requires iOS 8.0+
.
License
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];
安装
CocoaPods
- 在 Podfile 中添加
pod 'XYFSnowAnimation'
。 - 执行
pod install
或pod update
。 - 导入 <NSTimer+XYFSnowAnimation.h>。
手动安装
- 下载 XYFSnowAnimation 并找到 XYFSnowAnimationDemo/XYFSnowAnimation 文件夹。
- 将 XYFSnowAnimation 文件夹内的源文件添加(拖放)到你的工程。
- 导入
NSTimer+XYFSnowAnimation.h
。
系统要求
该工具最低支持 iOS 8.0
。
许可证
XYFSnowAnimation 使用 MIT 许可证,详情见 LICENSE 文件。
Preview(预览效果动态图):
Tip(提示):It may need to load for a while to show dynamic effect.可能需要加载一会才能看到动态效果。
Contact me (联系我)
QQ:2016003298
微信(WeChat):yz33915958