react-native-navigation的迁移库

RNNTitleOptions.m 786B

123456789101112131415161718192021222324
  1. #import "RNNTitleOptions.h"
  2. @implementation RNNTitleOptions
  3. - (instancetype)initWithDict:(NSDictionary *)dict {
  4. self = [super init];
  5. self.text = [TextParser parse:dict key:@"text"];
  6. self.fontFamily = [TextParser parse:dict key:@"fontFamily"];
  7. self.fontSize = [NumberParser parse:dict key:@"fontSize"];
  8. self.fontWeight = [TextParser parse:dict key:@"fontWeight"];
  9. self.color = [ColorParser parse:dict key:@"color"];
  10. self.component = [[RNNComponentOptions alloc] initWithDict:dict[@"component"]];
  11. return self;
  12. }
  13. - (BOOL)hasValue {
  14. return self.text.hasValue || self.fontFamily.hasValue || self.fontSize.hasValue || self.fontWeight.hasValue || self.color.hasValue || self.component.hasValue || self.componentAlignment.hasValue;
  15. }
  16. @end