react-native-navigation的迁移库

RNNTransitionOptions.m 606B

123456789101112131415161718192021222324252627282930
  1. #import "RNNTransitionOptions.h"
  2. #define DEFAULT_DURATION @(0.7)
  3. #define DEFAULT_SPRING_VELOCITY @(0.8)
  4. #define DEFAULT_SPRING_DAMPING @(0.85)
  5. @implementation RNNTransitionOptions
  6. - (instancetype)initWithDict:(NSDictionary *)dict {
  7. if (!dict[@"animations"]) {
  8. return nil;
  9. }
  10. return [super initWithDict:dict];
  11. }
  12. - (NSNumber *)duration {
  13. return _duration ? _duration : DEFAULT_DURATION;
  14. }
  15. - (NSNumber *)springVelocity {
  16. return _springVelocity ? _springVelocity : DEFAULT_SPRING_VELOCITY;
  17. }
  18. - (NSNumber *)springDamping {
  19. return _springDamping ? _springDamping : DEFAULT_SPRING_DAMPING;
  20. }
  21. @end