SNAnimations
动画构建工具,CABasicAnimation的封装和转场动画的管理
特性
- 提供快速创建淡入、淡出、放大、摇晃等常用基本动画的能力
- 提供动画结束的回调
- 兼容iOS 10之后的CAAnimationDelegate
使用
#import <snanimations.h>
CABasicAnimation * animation = [SNAnimations shakeAnimationformValue:-5 toValue:5 repeatCount:5 duration:1];
[self.button sn_addAnimation:animation didStartBlock:^(CAAnimation *Animation) {
NSLog(@"===========start==============");
} didStopBlock:^(CAAnimation *Animation) {
NSLog(@"===========stop===============");
} beforeStopblock:^(CAAnimation *Animation) {
NSLog(@"===========before stop========");
}];
安装
pod 'SNAnimations'
需求
iOS 8.0 或更高版本
问题
后续版本可能会增加对转场动画的支持
感谢
特此感谢pop、lottie-ios
许可证
SNAnimations基于MIT许可证发布。详情请见LICENSE。