{"id":13414857,"url":"https://github.com/ibireme/YYModel","last_synced_at":"2025-03-14T22:32:15.653Z","repository":{"id":40617329,"uuid":"44761786","full_name":"ibireme/YYModel","owner":"ibireme","description":"High performance model framework for iOS/OSX.","archived":false,"fork":false,"pushed_at":"2022-12-21T11:22:17.000Z","size":920,"stargazers_count":4341,"open_issues_count":137,"forks_count":916,"subscribers_count":103,"default_branch":"master","last_synced_at":"2024-10-29T21:59:28.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibireme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-22T17:30:43.000Z","updated_at":"2024-10-25T15:37:27.000Z","dependencies_parsed_at":"2022-07-31T23:48:50.969Z","dependency_job_id":null,"html_url":"https://github.com/ibireme/YYModel","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYModel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYModel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYModel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYModel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibireme","download_url":"https://codeload.github.com/ibireme/YYModel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658055,"owners_count":20326459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:38.474Z","updated_at":"2025-03-14T22:32:15.323Z","avatar_url":"https://github.com/ibireme.png","language":"Objective-C","readme":"YYModel\n==============\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYModel/master/LICENSE)\u0026nbsp;\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\u0026nbsp;\n[![CocoaPods](http://img.shields.io/cocoapods/v/YYModel.svg?style=flat)](http://cocoapods.org/pods/YYModel)\u0026nbsp;\n[![CocoaPods](http://img.shields.io/cocoapods/p/YYModel.svg?style=flat)](http://cocoadocs.org/docsets/YYModel)\u0026nbsp;\n[![Build Status](https://travis-ci.org/ibireme/YYModel.svg?branch=master)](https://travis-ci.org/ibireme/YYModel)\u0026nbsp;\n[![codecov.io](https://codecov.io/github/ibireme/YYModel/coverage.svg?branch=master)](https://codecov.io/github/ibireme/YYModel?branch=master)\n\nHigh performance model framework for iOS/OSX.\u003cbr/\u003e\n(It's a component of [YYKit](https://github.com/ibireme/YYKit))\n\n\nPerformance\n==============\n\nTime cost (process GithubUser 10000 times on iPhone 6):\n\n![Benchmark result](https://raw.github.com/ibireme/YYModel/master/Benchmark/Result.png\n)\n\nSee `Benchmark/ModelBenchmark.xcodeproj` for more benchmark case.\n\n\nFeatures\n==============\n- **High performance**: The conversion performance is close to handwriting code.\n- **Automatic type conversion**: The object types can be automatically converted.\n- **Type Safe**: All data types will be verified to ensure type-safe during the conversion process.\n- **Non-intrusive**: There is no need to make the model class inherit from other base class.\n- **Lightwight**: This library contains only 5 files.\n- **Docs and unit testing**: 100% docs coverage, 99.6% code coverage.\n\nUsage\n==============\n\n### Simple model json convert\n```objc\n// JSON:\n{\n    \"uid\":123456,\n    \"name\":\"Harry\",\n    \"created\":\"1965-07-31T00:00:00+0000\"\n}\n\n// Model:\n@interface User : NSObject\n@property UInt64 uid;\n@property NSString *name;\n@property NSDate *created;\n@end\n@implementation User\n@end\n\n\t\n// Convert json to model:\nUser *user = [User yy_modelWithJSON:json];\n\t\n// Convert model to json:\nNSDictionary *json = [user yy_modelToJSONObject];\n```\n\nIf the type of an object in JSON/Dictionary cannot be matched to the property of the model, the following automatic conversion is performed. If the automatic conversion failed, the value will be ignored.\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eJSON/Dictionary\u003c/th\u003e\n      \u003cth\u003eModel\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSString\u003c/td\u003e\n      \u003ctd\u003eNSNumber,NSURL,SEL,Class\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSNumber\u003c/td\u003e\n      \u003ctd\u003eNSString\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSString/NSNumber\u003c/td\u003e\n      \u003ctd\u003eC number (BOOL,int,float,NSUInteger,UInt64,...)\u003cbr/\u003e\n      NaN and Inf will be ignored\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSString\u003c/td\u003e\n      \u003ctd\u003eNSDate parsed with these formats:\u003cbr/\u003e\n      yyyy-MM-dd\u003cbr/\u003e\nyyyy-MM-dd HH:mm:ss\u003cbr/\u003e\nyyyy-MM-dd'T'HH:mm:ss\u003cbr/\u003e\nyyyy-MM-dd'T'HH:mm:ssZ\u003cbr/\u003e\nEEE MMM dd HH:mm:ss Z yyyy\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSDate\u003c/td\u003e\n      \u003ctd\u003eNSString formatted with ISO8601:\u003cbr/\u003e\n      \"YYYY-MM-dd'T'HH:mm:ssZ\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSValue\u003c/td\u003e\n      \u003ctd\u003estruct (CGRect,CGSize,...)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSNull\u003c/td\u003e\n      \u003ctd\u003enil,0\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\"no\",\"false\",...\u003c/td\u003e\n      \u003ctd\u003e@(NO),0\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\"yes\",\"true\",...\u003c/td\u003e\n      \u003ctd\u003e@(YES),1\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\n### Match model property to different JSON key\n```objc\n// JSON:\n{\n    \"n\":\"Harry Pottery\",\n    \"p\": 256,\n    \"ext\" : {\n        \"desc\" : \"A book written by J.K.Rowing.\"\n    },\n    \"ID\" : 100010\n}\n\n// Model:\n@interface Book : NSObject\n@property NSString *name;\n@property NSInteger page;\n@property NSString *desc;\n@property NSString *bookID;\n@end\n@implementation Book\n+ (NSDictionary *)modelCustomPropertyMapper {\n    return @{@\"name\" : @\"n\",\n             @\"page\" : @\"p\",\n             @\"desc\" : @\"ext.desc\",\n             @\"bookID\" : @[@\"id\",@\"ID\",@\"book_id\"]};\n}\n@end\n```\n\nYou can map a json key (key path) or an array of json key (key path) to one or multiple property name. If there's no mapper for a property, it will use the property's name as default.\n\n### Nested model\n```objc\n// JSON\n{\n    \"author\":{\n        \"name\":\"J.K.Rowling\",\n        \"birthday\":\"1965-07-31T00:00:00+0000\"\n    },\n    \"name\":\"Harry Potter\",\n    \"pages\":256\n}\n\n// Model: (no need to do anything)\n@interface Author : NSObject\n@property NSString *name;\n@property NSDate *birthday;\n@end\n@implementation Author\n@end\n\t\n@interface Book : NSObject\n@property NSString *name;\n@property NSUInteger pages;\n@property Author *author;\n@end\n@implementation Book\n@end\n```\n\n### Container property\n```objc\n@class Shadow, Border, Attachment;\n\n@interface Attributes\n@property NSString *name;\n@property NSArray *shadows; //Array\u003cShadow\u003e\n@property NSSet *borders; //Set\u003cBorder\u003e\n@property NSMutableDictionary *attachments; //Dict\u003cNSString,Attachment\u003e\n@end\n\n@implementation Attributes\n+ (NSDictionary *)modelContainerPropertyGenericClass {\n\t// value should be Class or Class name.\n    return @{@\"shadows\" : [Shadow class],\n             @\"borders\" : Border.class,\n             @\"attachments\" : @\"Attachment\" };\n}\n@end\n```\n\n### Whitelist and blacklist\n```objc\n@interface User\n@property NSString *name;\n@property NSUInteger age;\n@end\n\t\n@implementation Attributes\n+ (NSArray *)modelPropertyBlacklist {\n    return @[@\"test1\", @\"test2\"];\n}\n+ (NSArray *)modelPropertyWhitelist {\n    return @[@\"name\"];\n}\n@end\n```\n\n### Data validate and custom transform\n```objc\n// JSON:\n{\n\t\"name\":\"Harry\",\n\t\"timestamp\" : 1445534567\n}\n\t\n// Model:\n@interface User\n@property NSString *name;\n@property NSDate *createdAt;\n@end\n\n@implementation User\n- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {\n    NSNumber *timestamp = dic[@\"timestamp\"];\n    if (![timestamp isKindOfClass:[NSNumber class]]) return NO;\n    _createdAt = [NSDate dateWithTimeIntervalSince1970:timestamp.floatValue];\n    return YES;\n}\n- (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic {\n    if (!_createdAt) return NO;\n    dic[@\"timestamp\"] = @(n.timeIntervalSince1970);\n    return YES;\n}\n@end\n```\n\n### Coding/Copying/hash/equal/description\n```objc\n@interface YYShadow :NSObject \u003cNSCoding, NSCopying\u003e\n@property (nonatomic, copy) NSString *name;\n@property (nonatomic, assign) CGSize size;\n@end\n\n@implementation YYShadow\n- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }\n- (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }\n- (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; }\n- (NSUInteger)hash { return [self yy_modelHash]; }\n- (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; }\n- (NSString *)description { return [self yy_modelDescription]; }\n@end\n```\n\nInstallation\n==============\n\n### CocoaPods\n\n1. Add `pod 'YYModel'` to your Podfile.\n2. Run `pod install` or `pod update`.\n3. Import \\\u003cYYModel/YYModel.h\\\u003e.\n\n\n### Carthage\n\n1. Add `github \"ibireme/YYModel\"` to your Cartfile.\n2. Run `carthage update --platform ios` and add the framework to your project.\n3. Import \\\u003cYYModel/YYModel.h\\\u003e.\n\n\n### Manually\n\n1. Download all the files in the YYModel subdirectory.\n2. Add the source files to your Xcode project.\n3. Import `YYModel.h`.\n\n\nDocumentation\n==============\nFull API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYModel/).\u003cbr/\u003e\nYou can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc).\n\n\nRequirements\n==============\nThis library requires `iOS 6.0+` and `Xcode 8.0+`.\n\n\nLicense\n==============\nYYModel is provided under the MIT license. See LICENSE file for details.\n\n\n\u003cbr/\u003e\u003cbr/\u003e\n---\n中文介绍\n==============\n高性能 iOS/OSX 模型转换框架。\u003cbr/\u003e\n(该项目是 [YYKit](https://github.com/ibireme/YYKit) 组件之一)\n\n\n性能\n==============\n处理 GithubUser 数据 10000 次耗时统计 (iPhone 6):\n\n![Benchmark result](https://raw.github.com/ibireme/YYModel/master/Benchmark/Result.png\n)\n\n更多测试代码和用例见 `Benchmark/ModelBenchmark.xcodeproj`。\n\n\n特性\n==============\n- **高性能**: 模型转换性能接近手写解析代码。\n- **自动类型转换**: 对象类型可以自动转换，详情见下方表格。\n- **类型安全**: 转换过程中，所有的数据类型都会被检测一遍，以保证类型安全，避免崩溃问题。\n- **无侵入性**: 模型无需继承自其他基类。\n- **轻量**: 该框架只有 5 个文件 (包括.h文件)。\n- **文档和单元测试**: 文档覆盖率100%, 代码覆盖率99.6%。\n\n使用方法\n==============\n\n### 简单的 Model 与 JSON 相互转换\n```objc\n// JSON:\n{\n    \"uid\":123456,\n    \"name\":\"Harry\",\n    \"created\":\"1965-07-31T00:00:00+0000\"\n}\n\n// Model:\n@interface User : NSObject\n@property UInt64 uid;\n@property NSString *name;\n@property NSDate *created;\n@end\n@implementation User\n@end\n\n\t\n// 将 JSON (NSData,NSString,NSDictionary) 转换为 Model:\nUser *user = [User yy_modelWithJSON:json];\n\t\n// 将 Model 转换为 JSON 对象:\nNSDictionary *json = [user yy_modelToJSONObject];\n```\n\n当 JSON/Dictionary 中的对象类型与 Model 属性不一致时，YYModel 将会进行如下自动转换。自动转换不支持的值将会被忽略，以避免各种潜在的崩溃问题。\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eJSON/Dictionary\u003c/th\u003e\n      \u003cth\u003eModel\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSString\u003c/td\u003e\n      \u003ctd\u003eNSNumber,NSURL,SEL,Class\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSNumber\u003c/td\u003e\n      \u003ctd\u003eNSString\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSString/NSNumber\u003c/td\u003e\n      \u003ctd\u003e基础类型 (BOOL,int,float,NSUInteger,UInt64,...)\u003cbr/\u003e\n      NaN 和 Inf 会被忽略\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSString\u003c/td\u003e\n      \u003ctd\u003eNSDate 以下列格式解析:\u003cbr/\u003e\n      yyyy-MM-dd\u003cbr/\u003e\nyyyy-MM-dd HH:mm:ss\u003cbr/\u003e\nyyyy-MM-dd'T'HH:mm:ss\u003cbr/\u003e\nyyyy-MM-dd'T'HH:mm:ssZ\u003cbr/\u003e\nEEE MMM dd HH:mm:ss Z yyyy\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSDate\u003c/td\u003e\n      \u003ctd\u003eNSString 格式化为 ISO8601:\u003cbr/\u003e\n      \"YYYY-MM-dd'T'HH:mm:ssZ\"\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSValue\u003c/td\u003e\n      \u003ctd\u003estruct (CGRect,CGSize,...)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eNSNull\u003c/td\u003e\n      \u003ctd\u003enil,0\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\"no\",\"false\",...\u003c/td\u003e\n      \u003ctd\u003e@(NO),0\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\"yes\",\"true\",...\u003c/td\u003e\n      \u003ctd\u003e@(YES),1\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n### Model 属性名和 JSON 中的 Key 不相同\n```objc\n// JSON:\n{\n    \"n\":\"Harry Pottery\",\n    \"p\": 256,\n    \"ext\" : {\n        \"desc\" : \"A book written by J.K.Rowing.\"\n    },\n    \"ID\" : 100010\n}\n\n// Model:\n@interface Book : NSObject\n@property NSString *name;\n@property NSInteger page;\n@property NSString *desc;\n@property NSString *bookID;\n@end\n@implementation Book\n//返回一个 Dict，将 Model 属性名对映射到 JSON 的 Key。\n+ (NSDictionary *)modelCustomPropertyMapper {\n    return @{@\"name\" : @\"n\",\n             @\"page\" : @\"p\",\n             @\"desc\" : @\"ext.desc\",\n             @\"bookID\" : @[@\"id\",@\"ID\",@\"book_id\"]};\n}\n@end\n```\n\t\n你可以把一个或一组 json key (key path) 映射到一个或多个属性。如果一个属性没有映射关系，那默认会使用相同属性名作为映射。\n\n在 json-\u003emodel 的过程中：如果一个属性对应了多个 json key，那么转换过程会按顺序查找，并使用第一个不为空的值。\n\t\n在 model-\u003ejson 的过程中：如果一个属性对应了多个 json key (key path)，那么转换过程仅会处理第一个 json key (key path)；如果多个属性对应了同一个 json key，则转换过过程会使用其中任意一个不为空的值。\n\n### Model 包含其他 Model\n```objc\n// JSON\n{\n    \"author\":{\n        \"name\":\"J.K.Rowling\",\n        \"birthday\":\"1965-07-31T00:00:00+0000\"\n    },\n    \"name\":\"Harry Potter\",\n    \"pages\":256\n}\n\n// Model: 什么都不用做，转换会自动完成\n@interface Author : NSObject\n@property NSString *name;\n@property NSDate *birthday;\n@end\n@implementation Author\n@end\n\t\n@interface Book : NSObject\n@property NSString *name;\n@property NSUInteger pages;\n@property Author *author; //Book 包含 Author 属性\n@end\n@implementation Book\n@end\n```\t\n\n### 容器类属性\n```objc\n@class Shadow, Border, Attachment;\n\n@interface Attributes\n@property NSString *name;\n@property NSArray *shadows; //Array\u003cShadow\u003e\n@property NSSet *borders; //Set\u003cBorder\u003e\n@property NSMutableDictionary *attachments; //Dict\u003cNSString,Attachment\u003e\n@end\n\n@implementation Attributes\n// 返回容器类中的所需要存放的数据类型 (以 Class 或 Class Name 的形式)。\n+ (NSDictionary *)modelContainerPropertyGenericClass {\n    return @{@\"shadows\" : [Shadow class],\n             @\"borders\" : Border.class,\n             @\"attachments\" : @\"Attachment\" };\n}\n@end\n```\n\n### 黑名单与白名单\n```objc\n@interface User\n@property NSString *name;\n@property NSUInteger age;\n@end\n\t\n@implementation Attributes\n// 如果实现了该方法，则处理过程中会忽略该列表内的所有属性\n+ (NSArray *)modelPropertyBlacklist {\n    return @[@\"test1\", @\"test2\"];\n}\n// 如果实现了该方法，则处理过程中不会处理该列表外的属性。\n+ (NSArray *)modelPropertyWhitelist {\n    return @[@\"name\"];\n}\n@end\n```\n\n### 数据校验与自定义转换\n```objc\t\n// JSON:\n{\n\t\"name\":\"Harry\",\n\t\"timestamp\" : 1445534567\n}\n\t\n// Model:\n@interface User\n@property NSString *name;\n@property NSDate *createdAt;\n@end\n\n@implementation User\n// 当 JSON 转为 Model 完成后，该方法会被调用。\n// 你可以在这里对数据进行校验，如果校验不通过，可以返回 NO，则该 Model 会被忽略。\n// 你也可以在这里做一些自动转换不能完成的工作。\n- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {\n    NSNumber *timestamp = dic[@\"timestamp\"];\n    if (![timestamp isKindOfClass:[NSNumber class]]) return NO;\n    _createdAt = [NSDate dateWithTimeIntervalSince1970:timestamp.floatValue];\n    return YES;\n}\n\t\n// 当 Model 转为 JSON 完成后，该方法会被调用。\n// 你可以在这里对数据进行校验，如果校验不通过，可以返回 NO，则该 Model 会被忽略。\n// 你也可以在这里做一些自动转换不能完成的工作。\n- (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic {\n    if (!_createdAt) return NO;\n    dic[@\"timestamp\"] = @(n.timeIntervalSince1970);\n    return YES;\n}\n@end\n```\n\n### Coding/Copying/hash/equal/description\n```objc\n@interface YYShadow :NSObject \u003cNSCoding, NSCopying\u003e\n@property (nonatomic, copy) NSString *name;\n@property (nonatomic, assign) CGSize size;\n@end\n\n@implementation YYShadow\n// 直接添加以下代码即可自动完成\n- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }\n- (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }\n- (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; }\n- (NSUInteger)hash { return [self yy_modelHash]; }\n- (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; }\n- (NSString *)description { return [self yy_modelDescription]; }\n@end\n```\n\n安装\n==============\n\n### CocoaPods\n\n1. 在 Podfile 中添加 `pod 'YYModel'`。\n2. 执行 `pod install` 或 `pod update`。\n3. 导入 \\\u003cYYModel/YYModel.h\\\u003e。\n\n\n### Carthage\n\n1. 在 Cartfile 中添加 `github \"ibireme/YYModel\"`。\n2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。\n3. 导入 \\\u003cYYModel/YYModel.h\\\u003e。\n\n\n### 手动安装\n\n1. 下载 YYModel 文件夹内的所有内容。\n2. 将 YYModel 内的源文件添加(拖放)到你的工程。\n3. 导入 `YYModel.h`。\n\n\n文档\n==============\n你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYModel/) 查看在线 API 文档，也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。\n\n\n系统要求\n==============\n该项目最低支持 `iOS 6.0` 和 `Xcode 8.0`。\n\n\n许可证\n==============\nYYModel 使用 MIT 许可证，详情见 LICENSE 文件。\n\n相关链接\n==============\n\n[iOS JSON 模型转换库评测](https://blog.ibireme.com/2015/10/23/ios_model_framework_benchmark/)\n\n","funding_links":[],"categories":["Objective-C","HarmonyOS","iOS","框架和库","Parsing"],"sub_categories":["Windows Manager","YYKit"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibireme%2FYYModel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibireme%2FYYModel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibireme%2FYYModel/lists"}