动画构建者,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 is released under the MIT license. See LICENSE for details.