- 【点击直接下载,建议直接编译源码马上体验最新更全功能 https://github.com/liangdahong/BMExport/releases/download/2.0/BMExport2.0.dmg 】。
switch (obj.propertyType) {
case BMPropertyTypeInt:
[propertyArray addObject:[NSString stringWithFormat:@"var %@ = 0",
obj.propertyName]];
break;
case BMPropertyTypeBoolean:
[propertyArray addObject:[NSString stringWithFormat:@"var %@ = false",
obj.propertyName]];
break;
case BMPropertyTypeString:
[propertyArray addObject:[NSString stringWithFormat:@"var %@ = \"\"",
obj.propertyName]];
break;
case BMPropertyTypeArray:
[propertyArray addObject:[NSString stringWithFormat:@"var %@: Array<<#type#>> = []",
obj.propertyName]];
break;
case BMPropertyTypeDictionary:
[propertyArray addObject:[NSString stringWithFormat:@"var %@: <#type#>?",
obj.propertyName]];
break;
case BMPropertyTypeObject:
[propertyArray addObject:[NSString stringWithFormat:@"var %@: <#type#>?",
obj.propertyName]];
break;
default:
break;
}
switch (obj.propertyType) {
case BMPropertyTypeInt:
[propertyArray addObject:[NSString stringWithFormat:@"@property (nonatomic, assign) NSInteger %@;",
obj.propertyName]];
break;
case BMPropertyTypeBoolean:
[propertyArray addObject:[NSString stringWithFormat:@"@property (nonatomic, assign) BOOL %@;",
obj.propertyName]];
break;
case BMPropertyTypeString:
[propertyArray addObject:[NSString stringWithFormat:@"@property (nonatomic, copy) NSString *%@;",
obj.propertyName]];
break;
case BMPropertyTypeArray:
[propertyArray addObject:[NSString stringWithFormat:@"@property (nonatomic, copy) NSArray <<#type#> *> *%@;",
obj.propertyName]];
break;
case BMPropertyTypeDictionary:
[propertyArray addObject:[NSString stringWithFormat:@"@property (nonatomic, strong) <#type#> *%@;",
obj.propertyName]];
break;
case BMPropertyTypeObject:
[propertyArray addObject:[NSString stringWithFormat:@"@property (nonatomic, strong) <#type#> *%@;",
obj.propertyName]];
break;
default:
break;
}
- 考虑支持 Swift 的相关 Model 解析框架,如:HandyJSON,ObjectMapper。
- 支持自动生成
Model
文件; - 按属性类型排序等;
- 尝试实现网页版工具;
- 支持其他语言;
- 等。