react-native-navigation的迁移库

1234567891011121314
  1. #import "EnumParser.h"
  2. #import "NullEnum.h"
  3. @implementation EnumParser
  4. + (Enum *)parse:(NSDictionary *)json key:(NSString *)key ofClass:(Class)class {
  5. if (json[key]) {
  6. return [json[key] isKindOfClass:[NSString class]] ? [[class alloc] initWithValue:json[key]] : [NullEnum new];
  7. }
  8. return [NullEnum new];
  9. }
  10. @end