react-native-navigation的迁移库

1234567891011121314151617181920212223242526272829303132333435363738
  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. - (bool)isFalse {
  24. return self.value != nil && ![self.value boolValue];
  25. }
  26. @end