react-native-navigation的迁移库

Bool.m 463B

123456789101112131415161718192021222324252627282930313233
  1. #import "Bool.h"
  2. @interface Bool()
  3. @property (nonatomic, retain) NSNumber* value;
  4. @end
  5. @implementation Bool
  6. - (instancetype)initWithBOOL:(BOOL)boolValue {
  7. self = [super initWithValue:@(boolValue)];
  8. return self;
  9. }
  10. - (BOOL)get {
  11. return [self.value boolValue];
  12. }
  13. - (NSNumber *)getValue {
  14. return self.value;
  15. }
  16. - (BOOL)getWithDefaultValue:(BOOL)defaultValue {
  17. if (self.value) {
  18. return [self.value boolValue];
  19. } else {
  20. return defaultValue;
  21. }
  22. }
  23. @end