react-native-navigation的迁移库

RectTransition.m 644B

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