react-native-navigation的迁移库

ColorTransition.m 621B

12345678910111213141516171819
  1. #import "ColorTransition.h"
  2. #import "RNNInterpolator.h"
  3. @implementation ColorTransition
  4. - (instancetype)initWithView:(UIView *)view from:(UIColor *)from to:(UIColor *)to startDelay:(NSTimeInterval)startDelay duration:(NSTimeInterval)duration interpolation:(Text *)interpolation {
  5. self = [super initWithView:view startDelay:startDelay duration:duration interpolation:interpolation];
  6. _from = from;
  7. _to = to;
  8. return self;
  9. }
  10. - (CATransform3D)animateWithProgress:(CGFloat)p {
  11. self.view.backgroundColor = [RNNInterpolator fromColor:_from toColor:_to precent:p];
  12. return CATransform3DIdentity;
  13. }
  14. @end