react-native-navigation的迁移库

123456789101112131415161718192021222324252627282930
  1. #import "Double.h"
  2. @interface Double()
  3. @property (nonatomic, retain) NSNumber* value;
  4. @end
  5. @implementation Double
  6. + (instancetype)withValue:(double)value {
  7. return [[self.class alloc] initWithValue:@(value)];
  8. }
  9. - (double)get {
  10. return [[super get] doubleValue];
  11. }
  12. - (double)getWithDefaultValue:(double)defaultValue {
  13. if (self.value) {
  14. return [self.value doubleValue];
  15. } else if (defaultValue) {
  16. return defaultValue;
  17. }
  18. return 0;
  19. }
  20. @end