react-native-navigation的迁移库

OptionsArrayParser.m 495B

1234567891011121314151617181920
  1. #import "OptionsArrayParser.h"
  2. #import "RNNOptions.h"
  3. @implementation OptionsArrayParser
  4. + (NSArray *)parse:(NSDictionary *)json key:(NSString *)key ofClass:(Class)className {
  5. if (json[key]) {
  6. NSMutableArray* mutableArray = [NSMutableArray new];
  7. for (NSDictionary* dict in json[key]) {
  8. RNNOptions* options = [[className alloc] initWithDict:dict];
  9. [mutableArray addObject:options];
  10. }
  11. return mutableArray;
  12. }
  13. return nil;
  14. }
  15. @end