├── DictToModelDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ChenMan.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ChenMan.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── DictToModelDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CellModel.h ├── CellModel.m ├── ConvertKit │ ├── NSObject+EnumArr.h │ ├── NSObject+EnumArr.m │ ├── NSObject+EnumDict.h │ ├── NSObject+EnumDict.m │ ├── NSObject+EnumDictOneLevel.h │ └── NSObject+EnumDictOneLevel.m ├── Info.plist ├── PersonModel.h ├── PersonModel.m ├── Status.h ├── Status.m ├── ViewController.h ├── ViewController.m ├── main.m └── statuses.plist ├── DictToModelDemoTests ├── DictToModelDemoTests.m └── Info.plist ├── DictToModelDemoUITests ├── DictToModelDemoUITests.m └── Info.plist └── README.md /DictToModelDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F76767F520A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.m in Sources */ = {isa = PBXBuildFile; fileRef = F76767F420A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.m */; }; 11 | F79FC77A20A1904600EE661C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC77920A1904600EE661C /* AppDelegate.m */; }; 12 | F79FC77D20A1904600EE661C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC77C20A1904600EE661C /* ViewController.m */; }; 13 | F79FC78020A1904600EE661C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F79FC77E20A1904600EE661C /* Main.storyboard */; }; 14 | F79FC78220A1904600EE661C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F79FC78120A1904600EE661C /* Assets.xcassets */; }; 15 | F79FC78520A1904600EE661C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F79FC78320A1904600EE661C /* LaunchScreen.storyboard */; }; 16 | F79FC78820A1904600EE661C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC78720A1904600EE661C /* main.m */; }; 17 | F79FC79220A1904600EE661C /* DictToModelDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC79120A1904600EE661C /* DictToModelDemoTests.m */; }; 18 | F79FC79D20A1904600EE661C /* DictToModelDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC79C20A1904600EE661C /* DictToModelDemoUITests.m */; }; 19 | F79FC7AD20A1909700EE661C /* NSObject+EnumDict.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC7AC20A1909700EE661C /* NSObject+EnumDict.m */; }; 20 | F79FC7B020A191E200EE661C /* NSObject+EnumArr.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC7AF20A191E200EE661C /* NSObject+EnumArr.m */; }; 21 | F79FC7B320A192F300EE661C /* Status.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC7B220A192F300EE661C /* Status.m */; }; 22 | F79FC7B520A1968700EE661C /* statuses.plist in Resources */ = {isa = PBXBuildFile; fileRef = F79FC7B420A1968700EE661C /* statuses.plist */; }; 23 | F79FC7B820A196F600EE661C /* PersonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC7B720A196F600EE661C /* PersonModel.m */; }; 24 | F79FC7BB20A197A100EE661C /* CellModel.m in Sources */ = {isa = PBXBuildFile; fileRef = F79FC7B920A197A000EE661C /* CellModel.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | F79FC78E20A1904600EE661C /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = F79FC76D20A1904600EE661C /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = F79FC77420A1904600EE661C; 33 | remoteInfo = DictToModelDemo; 34 | }; 35 | F79FC79920A1904600EE661C /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = F79FC76D20A1904600EE661C /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = F79FC77420A1904600EE661C; 40 | remoteInfo = DictToModelDemo; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | F76767F320A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+EnumDictOneLevel.h"; sourceTree = ""; }; 46 | F76767F420A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+EnumDictOneLevel.m"; sourceTree = ""; }; 47 | F79FC77520A1904600EE661C /* DictToModelDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DictToModelDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | F79FC77820A1904600EE661C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | F79FC77920A1904600EE661C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | F79FC77B20A1904600EE661C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 51 | F79FC77C20A1904600EE661C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 52 | F79FC77F20A1904600EE661C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | F79FC78120A1904600EE661C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | F79FC78420A1904600EE661C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | F79FC78620A1904600EE661C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | F79FC78720A1904600EE661C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 57 | F79FC78D20A1904600EE661C /* DictToModelDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DictToModelDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | F79FC79120A1904600EE661C /* DictToModelDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DictToModelDemoTests.m; sourceTree = ""; }; 59 | F79FC79320A1904600EE661C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | F79FC79820A1904600EE661C /* DictToModelDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DictToModelDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | F79FC79C20A1904600EE661C /* DictToModelDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DictToModelDemoUITests.m; sourceTree = ""; }; 62 | F79FC79E20A1904600EE661C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | F79FC7AB20A1909700EE661C /* NSObject+EnumDict.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+EnumDict.h"; sourceTree = ""; }; 64 | F79FC7AC20A1909700EE661C /* NSObject+EnumDict.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+EnumDict.m"; sourceTree = ""; }; 65 | F79FC7AE20A191E200EE661C /* NSObject+EnumArr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+EnumArr.h"; sourceTree = ""; }; 66 | F79FC7AF20A191E200EE661C /* NSObject+EnumArr.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+EnumArr.m"; sourceTree = ""; }; 67 | F79FC7B120A192F300EE661C /* Status.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Status.h; sourceTree = ""; }; 68 | F79FC7B220A192F300EE661C /* Status.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Status.m; sourceTree = ""; }; 69 | F79FC7B420A1968700EE661C /* statuses.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = statuses.plist; sourceTree = ""; }; 70 | F79FC7B620A196F600EE661C /* PersonModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersonModel.h; sourceTree = ""; }; 71 | F79FC7B720A196F600EE661C /* PersonModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PersonModel.m; sourceTree = ""; }; 72 | F79FC7B920A197A000EE661C /* CellModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CellModel.m; sourceTree = ""; }; 73 | F79FC7BA20A197A100EE661C /* CellModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellModel.h; sourceTree = ""; }; 74 | /* End PBXFileReference section */ 75 | 76 | /* Begin PBXFrameworksBuildPhase section */ 77 | F79FC77220A1904600EE661C /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | F79FC78A20A1904600EE661C /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | F79FC79520A1904600EE661C /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | /* End PBXFrameworksBuildPhase section */ 99 | 100 | /* Begin PBXGroup section */ 101 | F79FC76C20A1904600EE661C = { 102 | isa = PBXGroup; 103 | children = ( 104 | F79FC77720A1904600EE661C /* DictToModelDemo */, 105 | F79FC79020A1904600EE661C /* DictToModelDemoTests */, 106 | F79FC79B20A1904600EE661C /* DictToModelDemoUITests */, 107 | F79FC77620A1904600EE661C /* Products */, 108 | ); 109 | sourceTree = ""; 110 | }; 111 | F79FC77620A1904600EE661C /* Products */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | F79FC77520A1904600EE661C /* DictToModelDemo.app */, 115 | F79FC78D20A1904600EE661C /* DictToModelDemoTests.xctest */, 116 | F79FC79820A1904600EE661C /* DictToModelDemoUITests.xctest */, 117 | ); 118 | name = Products; 119 | sourceTree = ""; 120 | }; 121 | F79FC77720A1904600EE661C /* DictToModelDemo */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | F79FC7AA20A1907000EE661C /* ConvertKit */, 125 | F79FC77820A1904600EE661C /* AppDelegate.h */, 126 | F79FC77920A1904600EE661C /* AppDelegate.m */, 127 | F79FC7B420A1968700EE661C /* statuses.plist */, 128 | F79FC7B120A192F300EE661C /* Status.h */, 129 | F79FC7B220A192F300EE661C /* Status.m */, 130 | F79FC7B620A196F600EE661C /* PersonModel.h */, 131 | F79FC7B720A196F600EE661C /* PersonModel.m */, 132 | F79FC7BA20A197A100EE661C /* CellModel.h */, 133 | F79FC7B920A197A000EE661C /* CellModel.m */, 134 | F79FC77B20A1904600EE661C /* ViewController.h */, 135 | F79FC77C20A1904600EE661C /* ViewController.m */, 136 | F79FC77E20A1904600EE661C /* Main.storyboard */, 137 | F79FC78120A1904600EE661C /* Assets.xcassets */, 138 | F79FC78320A1904600EE661C /* LaunchScreen.storyboard */, 139 | F79FC78620A1904600EE661C /* Info.plist */, 140 | F79FC78720A1904600EE661C /* main.m */, 141 | ); 142 | path = DictToModelDemo; 143 | sourceTree = ""; 144 | }; 145 | F79FC79020A1904600EE661C /* DictToModelDemoTests */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | F79FC79120A1904600EE661C /* DictToModelDemoTests.m */, 149 | F79FC79320A1904600EE661C /* Info.plist */, 150 | ); 151 | path = DictToModelDemoTests; 152 | sourceTree = ""; 153 | }; 154 | F79FC79B20A1904600EE661C /* DictToModelDemoUITests */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | F79FC79C20A1904600EE661C /* DictToModelDemoUITests.m */, 158 | F79FC79E20A1904600EE661C /* Info.plist */, 159 | ); 160 | path = DictToModelDemoUITests; 161 | sourceTree = ""; 162 | }; 163 | F79FC7AA20A1907000EE661C /* ConvertKit */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | F76767F320A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.h */, 167 | F76767F420A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.m */, 168 | F79FC7AB20A1909700EE661C /* NSObject+EnumDict.h */, 169 | F79FC7AC20A1909700EE661C /* NSObject+EnumDict.m */, 170 | F79FC7AE20A191E200EE661C /* NSObject+EnumArr.h */, 171 | F79FC7AF20A191E200EE661C /* NSObject+EnumArr.m */, 172 | ); 173 | path = ConvertKit; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXGroup section */ 177 | 178 | /* Begin PBXNativeTarget section */ 179 | F79FC77420A1904600EE661C /* DictToModelDemo */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = F79FC7A120A1904600EE661C /* Build configuration list for PBXNativeTarget "DictToModelDemo" */; 182 | buildPhases = ( 183 | F79FC77120A1904600EE661C /* Sources */, 184 | F79FC77220A1904600EE661C /* Frameworks */, 185 | F79FC77320A1904600EE661C /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = DictToModelDemo; 192 | productName = DictToModelDemo; 193 | productReference = F79FC77520A1904600EE661C /* DictToModelDemo.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | F79FC78C20A1904600EE661C /* DictToModelDemoTests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = F79FC7A420A1904600EE661C /* Build configuration list for PBXNativeTarget "DictToModelDemoTests" */; 199 | buildPhases = ( 200 | F79FC78920A1904600EE661C /* Sources */, 201 | F79FC78A20A1904600EE661C /* Frameworks */, 202 | F79FC78B20A1904600EE661C /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | F79FC78F20A1904600EE661C /* PBXTargetDependency */, 208 | ); 209 | name = DictToModelDemoTests; 210 | productName = DictToModelDemoTests; 211 | productReference = F79FC78D20A1904600EE661C /* DictToModelDemoTests.xctest */; 212 | productType = "com.apple.product-type.bundle.unit-test"; 213 | }; 214 | F79FC79720A1904600EE661C /* DictToModelDemoUITests */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = F79FC7A720A1904600EE661C /* Build configuration list for PBXNativeTarget "DictToModelDemoUITests" */; 217 | buildPhases = ( 218 | F79FC79420A1904600EE661C /* Sources */, 219 | F79FC79520A1904600EE661C /* Frameworks */, 220 | F79FC79620A1904600EE661C /* Resources */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | F79FC79A20A1904600EE661C /* PBXTargetDependency */, 226 | ); 227 | name = DictToModelDemoUITests; 228 | productName = DictToModelDemoUITests; 229 | productReference = F79FC79820A1904600EE661C /* DictToModelDemoUITests.xctest */; 230 | productType = "com.apple.product-type.bundle.ui-testing"; 231 | }; 232 | /* End PBXNativeTarget section */ 233 | 234 | /* Begin PBXProject section */ 235 | F79FC76D20A1904600EE661C /* Project object */ = { 236 | isa = PBXProject; 237 | attributes = { 238 | LastUpgradeCheck = 0920; 239 | ORGANIZATIONNAME = cimain; 240 | TargetAttributes = { 241 | F79FC77420A1904600EE661C = { 242 | CreatedOnToolsVersion = 9.2; 243 | ProvisioningStyle = Automatic; 244 | }; 245 | F79FC78C20A1904600EE661C = { 246 | CreatedOnToolsVersion = 9.2; 247 | ProvisioningStyle = Automatic; 248 | TestTargetID = F79FC77420A1904600EE661C; 249 | }; 250 | F79FC79720A1904600EE661C = { 251 | CreatedOnToolsVersion = 9.2; 252 | ProvisioningStyle = Automatic; 253 | TestTargetID = F79FC77420A1904600EE661C; 254 | }; 255 | }; 256 | }; 257 | buildConfigurationList = F79FC77020A1904600EE661C /* Build configuration list for PBXProject "DictToModelDemo" */; 258 | compatibilityVersion = "Xcode 8.0"; 259 | developmentRegion = en; 260 | hasScannedForEncodings = 0; 261 | knownRegions = ( 262 | en, 263 | Base, 264 | ); 265 | mainGroup = F79FC76C20A1904600EE661C; 266 | productRefGroup = F79FC77620A1904600EE661C /* Products */; 267 | projectDirPath = ""; 268 | projectRoot = ""; 269 | targets = ( 270 | F79FC77420A1904600EE661C /* DictToModelDemo */, 271 | F79FC78C20A1904600EE661C /* DictToModelDemoTests */, 272 | F79FC79720A1904600EE661C /* DictToModelDemoUITests */, 273 | ); 274 | }; 275 | /* End PBXProject section */ 276 | 277 | /* Begin PBXResourcesBuildPhase section */ 278 | F79FC77320A1904600EE661C /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | F79FC78520A1904600EE661C /* LaunchScreen.storyboard in Resources */, 283 | F79FC7B520A1968700EE661C /* statuses.plist in Resources */, 284 | F79FC78220A1904600EE661C /* Assets.xcassets in Resources */, 285 | F79FC78020A1904600EE661C /* Main.storyboard in Resources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | F79FC78B20A1904600EE661C /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | F79FC79620A1904600EE661C /* Resources */ = { 297 | isa = PBXResourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXResourcesBuildPhase section */ 304 | 305 | /* Begin PBXSourcesBuildPhase section */ 306 | F79FC77120A1904600EE661C /* Sources */ = { 307 | isa = PBXSourcesBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | F79FC77D20A1904600EE661C /* ViewController.m in Sources */, 311 | F79FC7B320A192F300EE661C /* Status.m in Sources */, 312 | F79FC7AD20A1909700EE661C /* NSObject+EnumDict.m in Sources */, 313 | F76767F520A28D5A002EDCA3 /* NSObject+EnumDictOneLevel.m in Sources */, 314 | F79FC78820A1904600EE661C /* main.m in Sources */, 315 | F79FC7BB20A197A100EE661C /* CellModel.m in Sources */, 316 | F79FC7B020A191E200EE661C /* NSObject+EnumArr.m in Sources */, 317 | F79FC77A20A1904600EE661C /* AppDelegate.m in Sources */, 318 | F79FC7B820A196F600EE661C /* PersonModel.m in Sources */, 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | }; 322 | F79FC78920A1904600EE661C /* Sources */ = { 323 | isa = PBXSourcesBuildPhase; 324 | buildActionMask = 2147483647; 325 | files = ( 326 | F79FC79220A1904600EE661C /* DictToModelDemoTests.m in Sources */, 327 | ); 328 | runOnlyForDeploymentPostprocessing = 0; 329 | }; 330 | F79FC79420A1904600EE661C /* Sources */ = { 331 | isa = PBXSourcesBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | F79FC79D20A1904600EE661C /* DictToModelDemoUITests.m in Sources */, 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | }; 338 | /* End PBXSourcesBuildPhase section */ 339 | 340 | /* Begin PBXTargetDependency section */ 341 | F79FC78F20A1904600EE661C /* PBXTargetDependency */ = { 342 | isa = PBXTargetDependency; 343 | target = F79FC77420A1904600EE661C /* DictToModelDemo */; 344 | targetProxy = F79FC78E20A1904600EE661C /* PBXContainerItemProxy */; 345 | }; 346 | F79FC79A20A1904600EE661C /* PBXTargetDependency */ = { 347 | isa = PBXTargetDependency; 348 | target = F79FC77420A1904600EE661C /* DictToModelDemo */; 349 | targetProxy = F79FC79920A1904600EE661C /* PBXContainerItemProxy */; 350 | }; 351 | /* End PBXTargetDependency section */ 352 | 353 | /* Begin PBXVariantGroup section */ 354 | F79FC77E20A1904600EE661C /* Main.storyboard */ = { 355 | isa = PBXVariantGroup; 356 | children = ( 357 | F79FC77F20A1904600EE661C /* Base */, 358 | ); 359 | name = Main.storyboard; 360 | sourceTree = ""; 361 | }; 362 | F79FC78320A1904600EE661C /* LaunchScreen.storyboard */ = { 363 | isa = PBXVariantGroup; 364 | children = ( 365 | F79FC78420A1904600EE661C /* Base */, 366 | ); 367 | name = LaunchScreen.storyboard; 368 | sourceTree = ""; 369 | }; 370 | /* End PBXVariantGroup section */ 371 | 372 | /* Begin XCBuildConfiguration section */ 373 | F79FC79F20A1904600EE661C /* Debug */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ALWAYS_SEARCH_USER_PATHS = NO; 377 | CLANG_ANALYZER_NONNULL = YES; 378 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 397 | CLANG_WARN_STRICT_PROTOTYPES = YES; 398 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 399 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 400 | CLANG_WARN_UNREACHABLE_CODE = YES; 401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 402 | CODE_SIGN_IDENTITY = "iPhone Developer"; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = dwarf; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | ENABLE_TESTABILITY = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu11; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 422 | MTL_ENABLE_DEBUG_INFO = YES; 423 | ONLY_ACTIVE_ARCH = YES; 424 | SDKROOT = iphoneos; 425 | }; 426 | name = Debug; 427 | }; 428 | F79FC7A020A1904600EE661C /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ANALYZER_NONNULL = YES; 433 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 439 | CLANG_WARN_BOOL_CONVERSION = YES; 440 | CLANG_WARN_COMMA = YES; 441 | CLANG_WARN_CONSTANT_CONVERSION = YES; 442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 443 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 444 | CLANG_WARN_EMPTY_BODY = YES; 445 | CLANG_WARN_ENUM_CONVERSION = YES; 446 | CLANG_WARN_INFINITE_RECURSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 452 | CLANG_WARN_STRICT_PROTOTYPES = YES; 453 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 454 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 455 | CLANG_WARN_UNREACHABLE_CODE = YES; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | CODE_SIGN_IDENTITY = "iPhone Developer"; 458 | COPY_PHASE_STRIP = NO; 459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 460 | ENABLE_NS_ASSERTIONS = NO; 461 | ENABLE_STRICT_OBJC_MSGSEND = YES; 462 | GCC_C_LANGUAGE_STANDARD = gnu11; 463 | GCC_NO_COMMON_BLOCKS = YES; 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 471 | MTL_ENABLE_DEBUG_INFO = NO; 472 | SDKROOT = iphoneos; 473 | VALIDATE_PRODUCT = YES; 474 | }; 475 | name = Release; 476 | }; 477 | F79FC7A220A1904600EE661C /* Debug */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 481 | CODE_SIGN_STYLE = Automatic; 482 | DEVELOPMENT_TEAM = G9A57BVG7J; 483 | INFOPLIST_FILE = DictToModelDemo/Info.plist; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 485 | PRODUCT_BUNDLE_IDENTIFIER = com.cimain.runtime.DictToModelDemo; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | TARGETED_DEVICE_FAMILY = "1,2"; 488 | }; 489 | name = Debug; 490 | }; 491 | F79FC7A320A1904600EE661C /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 495 | CODE_SIGN_STYLE = Automatic; 496 | DEVELOPMENT_TEAM = G9A57BVG7J; 497 | INFOPLIST_FILE = DictToModelDemo/Info.plist; 498 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 499 | PRODUCT_BUNDLE_IDENTIFIER = com.cimain.runtime.DictToModelDemo; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | TARGETED_DEVICE_FAMILY = "1,2"; 502 | }; 503 | name = Release; 504 | }; 505 | F79FC7A520A1904600EE661C /* Debug */ = { 506 | isa = XCBuildConfiguration; 507 | buildSettings = { 508 | BUNDLE_LOADER = "$(TEST_HOST)"; 509 | CODE_SIGN_STYLE = Automatic; 510 | DEVELOPMENT_TEAM = G9A57BVG7J; 511 | INFOPLIST_FILE = DictToModelDemoTests/Info.plist; 512 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 513 | PRODUCT_BUNDLE_IDENTIFIER = com.cimain.runtime.DictToModelDemoTests; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | TARGETED_DEVICE_FAMILY = "1,2"; 516 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DictToModelDemo.app/DictToModelDemo"; 517 | }; 518 | name = Debug; 519 | }; 520 | F79FC7A620A1904600EE661C /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | BUNDLE_LOADER = "$(TEST_HOST)"; 524 | CODE_SIGN_STYLE = Automatic; 525 | DEVELOPMENT_TEAM = G9A57BVG7J; 526 | INFOPLIST_FILE = DictToModelDemoTests/Info.plist; 527 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 528 | PRODUCT_BUNDLE_IDENTIFIER = com.cimain.runtime.DictToModelDemoTests; 529 | PRODUCT_NAME = "$(TARGET_NAME)"; 530 | TARGETED_DEVICE_FAMILY = "1,2"; 531 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DictToModelDemo.app/DictToModelDemo"; 532 | }; 533 | name = Release; 534 | }; 535 | F79FC7A820A1904600EE661C /* Debug */ = { 536 | isa = XCBuildConfiguration; 537 | buildSettings = { 538 | CODE_SIGN_STYLE = Automatic; 539 | DEVELOPMENT_TEAM = G9A57BVG7J; 540 | INFOPLIST_FILE = DictToModelDemoUITests/Info.plist; 541 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 542 | PRODUCT_BUNDLE_IDENTIFIER = com.cimain.runtime.DictToModelDemoUITests; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | TARGETED_DEVICE_FAMILY = "1,2"; 545 | TEST_TARGET_NAME = DictToModelDemo; 546 | }; 547 | name = Debug; 548 | }; 549 | F79FC7A920A1904600EE661C /* Release */ = { 550 | isa = XCBuildConfiguration; 551 | buildSettings = { 552 | CODE_SIGN_STYLE = Automatic; 553 | DEVELOPMENT_TEAM = G9A57BVG7J; 554 | INFOPLIST_FILE = DictToModelDemoUITests/Info.plist; 555 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 556 | PRODUCT_BUNDLE_IDENTIFIER = com.cimain.runtime.DictToModelDemoUITests; 557 | PRODUCT_NAME = "$(TARGET_NAME)"; 558 | TARGETED_DEVICE_FAMILY = "1,2"; 559 | TEST_TARGET_NAME = DictToModelDemo; 560 | }; 561 | name = Release; 562 | }; 563 | /* End XCBuildConfiguration section */ 564 | 565 | /* Begin XCConfigurationList section */ 566 | F79FC77020A1904600EE661C /* Build configuration list for PBXProject "DictToModelDemo" */ = { 567 | isa = XCConfigurationList; 568 | buildConfigurations = ( 569 | F79FC79F20A1904600EE661C /* Debug */, 570 | F79FC7A020A1904600EE661C /* Release */, 571 | ); 572 | defaultConfigurationIsVisible = 0; 573 | defaultConfigurationName = Release; 574 | }; 575 | F79FC7A120A1904600EE661C /* Build configuration list for PBXNativeTarget "DictToModelDemo" */ = { 576 | isa = XCConfigurationList; 577 | buildConfigurations = ( 578 | F79FC7A220A1904600EE661C /* Debug */, 579 | F79FC7A320A1904600EE661C /* Release */, 580 | ); 581 | defaultConfigurationIsVisible = 0; 582 | defaultConfigurationName = Release; 583 | }; 584 | F79FC7A420A1904600EE661C /* Build configuration list for PBXNativeTarget "DictToModelDemoTests" */ = { 585 | isa = XCConfigurationList; 586 | buildConfigurations = ( 587 | F79FC7A520A1904600EE661C /* Debug */, 588 | F79FC7A620A1904600EE661C /* Release */, 589 | ); 590 | defaultConfigurationIsVisible = 0; 591 | defaultConfigurationName = Release; 592 | }; 593 | F79FC7A720A1904600EE661C /* Build configuration list for PBXNativeTarget "DictToModelDemoUITests" */ = { 594 | isa = XCConfigurationList; 595 | buildConfigurations = ( 596 | F79FC7A820A1904600EE661C /* Debug */, 597 | F79FC7A920A1904600EE661C /* Release */, 598 | ); 599 | defaultConfigurationIsVisible = 0; 600 | defaultConfigurationName = Release; 601 | }; 602 | /* End XCConfigurationList section */ 603 | }; 604 | rootObject = F79FC76D20A1904600EE661C /* Project object */; 605 | } 606 | -------------------------------------------------------------------------------- /DictToModelDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DictToModelDemo.xcodeproj/project.xcworkspace/xcuserdata/ChenMan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cimain/DictToModelDemo/5bc789b92c7be2361ccaa853b2cb47958e9c80d2/DictToModelDemo.xcodeproj/project.xcworkspace/xcuserdata/ChenMan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DictToModelDemo.xcodeproj/xcuserdata/ChenMan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 35 | 36 | 50 | 51 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 84 | 85 | 86 | 88 | 100 | 101 | 102 | 104 | 116 | 117 | 118 | 120 | 132 | 133 | 134 | 136 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /DictToModelDemo.xcodeproj/xcuserdata/ChenMan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DictToModelDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DictToModelDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DictToModelDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /DictToModelDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /DictToModelDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DictToModelDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DictToModelDemo/CellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoanManageCellModel.h 3 | // xiaoantimes 4 | // 5 | // Created by ChenMan on 2017/10/10. 6 | // Copyright © 2017年 XAT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CellModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *stateStr; 14 | @property (nonatomic, copy) NSString *partnerStr; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DictToModelDemo/CellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoanManageCellModel.m 3 | // xiaoantimes 4 | // 5 | // Created by ChenMan on 2017/10/10. 6 | // Copyright © 2017年 XAT. All rights reserved. 7 | // 8 | 9 | #import "CellModel.h" 10 | 11 | @implementation CellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DictToModelDemo/ConvertKit/NSObject+EnumArr.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+EnumArr.h 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ModelDelegate 12 | 13 | @optional 14 | // 提供一个协议,只要准备这个协议的类,都能把数组中的字典转模型 15 | // 用在三级数组转换 16 | + (NSDictionary *)arrayContainModelClass; 17 | 18 | @end 19 | 20 | 21 | @interface NSObject (EnumArr) 22 | 23 | // 字典转模型 24 | + (instancetype)modelWithDict:(NSDictionary *)dict; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DictToModelDemo/ConvertKit/NSObject+EnumArr.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+EnumArr.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import "NSObject+EnumArr.h" 10 | #import 11 | 12 | @implementation NSObject (EnumArr) 13 | 14 | /* 15 | * 把字典中所有value给模型中属性赋值, 16 | * KVC:遍历字典中所有key,去模型中查找 17 | * Runtime:根据模型中属性名去字典中查找对应value,如果找到就给模型的属性赋值. 18 | */ 19 | // 字典转模型 20 | + (instancetype)modelWithDict:(NSDictionary *)dict 21 | { 22 | // 创建对应模型对象 23 | id objc = [[self alloc] init]; 24 | 25 | 26 | unsigned int count = 0; 27 | 28 | // 1.获取成员属性数组 29 | Ivar *ivarList = class_copyIvarList(self, &count); 30 | 31 | // 2.遍历所有的成员属性名,一个一个去字典中取出对应的value给模型属性赋值 32 | for (int i = 0; i < count; i++) { 33 | 34 | // 2.1 获取成员属性 35 | Ivar ivar = ivarList[i]; 36 | 37 | // 2.2 获取成员属性名 C -> OC 字符串 38 | NSString *ivarName = [NSString stringWithUTF8String:ivar_getName(ivar)]; 39 | 40 | // 2.3 _成员属性名 => 字典key 41 | NSString *key = [ivarName substringFromIndex:1]; 42 | 43 | // 2.4 去字典中取出对应value给模型属性赋值 44 | id value = dict[key]; 45 | 46 | 47 | // 获取成员属性类型 48 | NSString *ivarType = [NSString stringWithUTF8String:ivar_getTypeEncoding(ivar)]; 49 | 50 | // 二级转换,字典中还有字典,也需要把对应字典转换成模型 51 | // 52 | // 判断下value,是不是字典 53 | if ([value isKindOfClass:[NSDictionary class]] && ![ivarType containsString:@"NS"]) { // 是字典对象,并且属性名对应类型是自定义类型 54 | // user User 55 | 56 | // 处理类型字符串 @\"User\" -> User 57 | ivarType = [ivarType stringByReplacingOccurrencesOfString:@"@" withString:@""]; 58 | ivarType = [ivarType stringByReplacingOccurrencesOfString:@"\"" withString:@""]; 59 | // 自定义对象,并且值是字典 60 | // value:user字典 -> User模型 61 | // 获取模型(user)类对象 62 | Class modalClass = NSClassFromString(ivarType); 63 | 64 | // 字典转模型 65 | if (modalClass) { 66 | // 字典转模型 user 67 | value = [modalClass modelWithDict:value]; 68 | } 69 | 70 | // 字典,user 71 | // NSLog(@"%@",key); 72 | } 73 | 74 | // 三级转换:NSArray中也是字典,把数组中的字典转换成模型. 75 | // 判断值是否是数组 76 | if ([value isKindOfClass:[NSArray class]]) { 77 | // 判断对应类有没有实现字典数组转模型数组的协议 78 | if ([self respondsToSelector:@selector(arrayContainModelClass)]) { 79 | 80 | // 转换成id类型,就能调用任何对象的方法 81 | id idSelf = self; 82 | 83 | // 获取数组中字典对应的模型 84 | NSString *type = [idSelf arrayContainModelClass][key]; 85 | 86 | // 生成模型 87 | Class classModel = NSClassFromString(type); 88 | NSMutableArray *arrM = [NSMutableArray array]; 89 | // 遍历字典数组,生成模型数组 90 | for (NSDictionary *dict in value) { 91 | // 字典转模型 92 | id model = [classModel modelWithDict:dict]; 93 | [arrM addObject:model]; 94 | } 95 | 96 | // 把模型数组赋值给value 97 | value = arrM; 98 | 99 | } 100 | } 101 | 102 | // 2.5 KVC字典转模型 103 | if (value) { 104 | [objc setValue:value forKey:key]; 105 | } 106 | } 107 | 108 | 109 | // 返回对象 110 | return objc; 111 | 112 | } 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /DictToModelDemo/ConvertKit/NSObject+EnumDict.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Convert.h 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (EnumDict) 12 | 13 | + (instancetype)cm_modelWithDict:(NSDictionary *)dict; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DictToModelDemo/ConvertKit/NSObject+EnumDict.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Convert.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import "NSObject+EnumDict.h" 10 | 11 | //导入模型 12 | #import "Status.h" 13 | #import 14 | 15 | @implementation NSObject (EnumDict) 16 | 17 | const char *kCMPropertyListKey = "CMPropertyListKey"; 18 | 19 | + (instancetype)cm_modelWithDict:(NSDictionary *)dict 20 | { 21 | /* 实例化对象 */ 22 | id model = [[self alloc]init]; 23 | 24 | /* 使用字典,设置对象信息 */ 25 | /* 1. 获得 self 的属性列表 */ 26 | NSArray *propertyList = [self cm_objcProperties]; 27 | 28 | /* 2. 遍历字典 */ 29 | [dict enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { 30 | 31 | /* 3. 判断 key 是否字 propertyList 中 */ 32 | if ([propertyList containsObject:key]) { 33 | 34 | // 获取成员属性类型 35 | // 类型经常变,抽出来 36 | NSString *ivarType; 37 | 38 | if ([obj isKindOfClass:NSClassFromString(@"__NSCFString")]) { 39 | ivarType = @"NSString"; 40 | }else if ([obj isKindOfClass:NSClassFromString(@"__NSCFArray")]){ 41 | ivarType = @"NSArray"; 42 | }else if ([obj isKindOfClass:NSClassFromString(@"__NSCFNumber")]){ 43 | ivarType = @"int"; 44 | }else if ([obj isKindOfClass:NSClassFromString(@"__NSCFDictionary")]){ 45 | ivarType = @"NSDictionary"; 46 | } 47 | 48 | // 二级转换,字典中还有字典,也需要把对应字典转换成模型 49 | // 判断下value,是不是字典 50 | if ([obj isKindOfClass:NSClassFromString(@"__NSCFDictionary")]) { // 是字典对象,并且属性名对应类型是自定义类型 51 | // value:user字典 -> User模型 52 | // 获取模型(user)类对象 53 | NSString *ivarType = [Status dictWithModelClass][key]; 54 | Class modalClass = NSClassFromString(ivarType); 55 | 56 | // 字典转模型 57 | if (modalClass) { 58 | // 字典转模型 user 59 | obj = [modalClass cm_modelWithDict:obj]; 60 | } 61 | 62 | } 63 | 64 | // 三级转换:NSArray中也是字典,把数组中的字典转换成模型. 65 | // 判断值是否是数组 66 | if ([obj isKindOfClass:[NSArray class]]) { 67 | // 判断对应类有没有实现字典数组转模型数组的协议 68 | if ([self respondsToSelector:@selector(arrayContainModelClass)]) { 69 | 70 | // 转换成id类型,就能调用任何对象的方法 71 | id idSelf = self; 72 | 73 | // 获取数组中字典对应的模型 74 | NSString *type = [idSelf arrayContainModelClass][key]; 75 | 76 | // 生成模型 77 | Class classModel = NSClassFromString(type); 78 | NSMutableArray *arrM = [NSMutableArray array]; 79 | // 遍历字典数组,生成模型数组 80 | for (NSDictionary *dict in obj) { 81 | // 字典转模型 82 | id model = [classModel cm_modelWithDict:dict]; 83 | [arrM addObject:model]; 84 | } 85 | 86 | // 把模型数组赋值给value 87 | obj = arrM; 88 | 89 | } 90 | } 91 | 92 | // KVC字典转模型 93 | if (obj) { 94 | /* 说明属性存在,可以使用 KVC 设置数值 */ 95 | [model setValue:obj forKey:key]; 96 | } 97 | } 98 | 99 | }]; 100 | 101 | /* 返回对象 */ 102 | return model; 103 | } 104 | 105 | + (NSArray *)cm_objcProperties 106 | { 107 | /* 获取关联对象 */ 108 | NSArray *ptyList = objc_getAssociatedObject(self, kCMPropertyListKey); 109 | 110 | /* 如果 ptyList 有值,直接返回 */ 111 | if (ptyList) { 112 | return ptyList; 113 | } 114 | /* 调用运行时方法, 取得类的属性列表 */ 115 | /* 成员变量: 116 | * class_copyIvarList(__unsafe_unretained Class cls, unsigned int *outCount) 117 | * 方法: 118 | * class_copyMethodList(__unsafe_unretained Class cls, unsigned int *outCount) 119 | * 属性: 120 | * class_copyPropertyList(__unsafe_unretained Class cls, unsigned int *outCount) 121 | * 协议: 122 | * class_copyProtocolList(__unsafe_unretained Class cls, unsigned int *outCount) 123 | */ 124 | unsigned int outCount = 0; 125 | /** 126 | * 参数1: 要获取得类 127 | * 参数2: 雷属性的个数指针 128 | * 返回值: 所有属性的数组, C 语言中,数组的名字,就是指向第一个元素的地址 129 | */ 130 | /* retain, creat, copy 需要release */ 131 | objc_property_t *propertyList = class_copyPropertyList([self class], &outCount); 132 | 133 | NSMutableArray *mtArray = [NSMutableArray array]; 134 | 135 | /* 遍历所有属性 */ 136 | for (unsigned int i = 0; i < outCount; i++) { 137 | /* 从数组中取得属性 */ 138 | objc_property_t property = propertyList[i]; 139 | /* 从 property 中获得属性名称 */ 140 | const char *propertyName_C = property_getName(property); 141 | /* 将 C 字符串转化成 OC 字符串 */ 142 | NSString *propertyName_OC = [NSString stringWithCString:propertyName_C encoding:NSUTF8StringEncoding]; 143 | [mtArray addObject:propertyName_OC]; 144 | } 145 | 146 | /* 设置关联对象 */ 147 | /** 148 | * 参数1 : 对象self 149 | * 参数2 : 动态添加属性的 key 150 | * 参数3 : 动态添加属性值 151 | * 参数4 : 对象的引用关系 152 | */ 153 | 154 | objc_setAssociatedObject(self, kCMPropertyListKey, mtArray.copy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 155 | /* 释放 */ 156 | free(propertyList); 157 | return mtArray.copy; 158 | 159 | } 160 | 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /DictToModelDemo/ConvertKit/NSObject+EnumDictOneLevel.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+EnumDictOneLevel.h 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/9. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (EnumDictOneLevel) 12 | 13 | + (instancetype)cm_modelWithDict1:(NSDictionary *)dict; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DictToModelDemo/ConvertKit/NSObject+EnumDictOneLevel.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+EnumDictOneLevel.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/9. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import "NSObject+EnumDictOneLevel.h" 10 | #import 11 | 12 | const char *kCMPropertyListKey1 = "CMPropertyListKey1"; 13 | 14 | @implementation NSObject (EnumDictOneLevel) 15 | 16 | + (instancetype)cm_modelWithDict1:(NSDictionary *)dict 17 | { 18 | /* 实例化对象 */ 19 | id model = [[self alloc]init]; 20 | 21 | /* 使用字典,设置对象信息 */ 22 | /* 1. 获得 self 的属性列表 */ 23 | NSArray *propertyList = [self cm_objcProperties]; 24 | 25 | /* 2. 遍历字典 */ 26 | [dict enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { 27 | 28 | /* 3. 判断 key 是否字 propertyList 中 */ 29 | if ([propertyList containsObject:key]) { 30 | 31 | // KVC字典转模型 32 | if (obj) { 33 | /* 说明属性存在,可以使用 KVC 设置数值 */ 34 | [model setValue:obj forKey:key]; 35 | } 36 | } 37 | 38 | }]; 39 | 40 | /* 返回对象 */ 41 | return model; 42 | } 43 | 44 | + (NSArray *)cm_objcProperties 45 | { 46 | /* 获取关联对象 */ 47 | NSArray *ptyList = objc_getAssociatedObject(self, kCMPropertyListKey1); 48 | 49 | /* 如果 ptyList 有值,直接返回 */ 50 | if (ptyList) { 51 | return ptyList; 52 | } 53 | /* 调用运行时方法, 取得类的属性列表 */ 54 | /* 成员变量: 55 | * class_copyIvarList(__unsafe_unretained Class cls, unsigned int *outCount) 56 | * 方法: 57 | * class_copyMethodList(__unsafe_unretained Class cls, unsigned int *outCount) 58 | * 属性: 59 | * class_copyPropertyList(__unsafe_unretained Class cls, unsigned int *outCount) 60 | * 协议: 61 | * class_copyProtocolList(__unsafe_unretained Class cls, unsigned int *outCount) 62 | */ 63 | unsigned int outCount = 0; 64 | /** 65 | * 参数1: 要获取得类 66 | * 参数2: 雷属性的个数指针 67 | * 返回值: 所有属性的数组, C 语言中,数组的名字,就是指向第一个元素的地址 68 | */ 69 | /* retain, creat, copy 需要release */ 70 | objc_property_t *propertyList = class_copyPropertyList([self class], &outCount); 71 | 72 | NSMutableArray *mtArray = [NSMutableArray array]; 73 | 74 | /* 遍历所有属性 */ 75 | for (unsigned int i = 0; i < outCount; i++) { 76 | /* 从数组中取得属性 */ 77 | objc_property_t property = propertyList[i]; 78 | /* 从 property 中获得属性名称 */ 79 | const char *propertyName_C = property_getName(property); 80 | /* 将 C 字符串转化成 OC 字符串 */ 81 | NSString *propertyName_OC = [NSString stringWithCString:propertyName_C encoding:NSUTF8StringEncoding]; 82 | [mtArray addObject:propertyName_OC]; 83 | } 84 | 85 | /* 设置关联对象 */ 86 | /** 87 | * 参数1 : 对象self 88 | * 参数2 : 动态添加属性的 key 89 | * 参数3 : 动态添加属性值 90 | * 参数4 : 对象的引用关系 91 | */ 92 | 93 | objc_setAssociatedObject(self, kCMPropertyListKey1, mtArray.copy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 94 | /* 释放 */ 95 | free(propertyList); 96 | return mtArray.copy; 97 | 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /DictToModelDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DictToModelDemo/PersonModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // PersonModel.h 3 | // xiaoantimes 4 | // 5 | // Created by Apple on 2017/11/3. 6 | // Copyright © 2017年 XAT. All rights reserved. 7 | // 8 | 9 | #import 10 | //#import "NSObject+EnumDict.h" 11 | //#import "NSObject+EnumArr.h" 12 | 13 | @interface PersonModel : NSObject 14 | 15 | @property (nonatomic, copy) NSString *iconStr; 16 | @property (nonatomic, copy) NSString *showStr; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DictToModelDemo/PersonModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // PersonModel.m 3 | // xiaoantimes 4 | // 5 | // Created by Apple on 2017/11/3. 6 | // Copyright © 2017年 XAT. All rights reserved. 7 | // 8 | 9 | #import "PersonModel.h" 10 | 11 | @implementation PersonModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DictToModelDemo/Status.h: -------------------------------------------------------------------------------- 1 | // 2 | // Status.h 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NSObject+EnumArr.h" 11 | #import "NSObject+EnumDict.h" 12 | 13 | @class PersonModel; 14 | 15 | @interface Status : NSObject 16 | 17 | @property (nonatomic, strong) NSString *title; 18 | 19 | @property (nonatomic, strong) PersonModel *person; 20 | 21 | @property (nonatomic, strong) NSArray *cellMdlArr; 22 | 23 | + (NSDictionary *)dictWithModelClass; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /DictToModelDemo/Status.m: -------------------------------------------------------------------------------- 1 | // 2 | // Status.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import "Status.h" 10 | 11 | @implementation Status 12 | 13 | + (NSDictionary *)arrayContainModelClass 14 | { 15 | return @{@"cellMdlArr" : @"CellModel"}; 16 | } 17 | 18 | + (NSDictionary *)dictWithModelClass 19 | { 20 | return @{@"person" : @"PersonModel"}; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /DictToModelDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DictToModelDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #import "NSObject+EnumDictOneLevel.h" 12 | 13 | #import "Status.h" 14 | #import "PersonModel.h" 15 | 16 | @interface ViewController () 17 | 18 | @property (nonatomic, copy) NSMutableArray *statuses; 19 | 20 | @end 21 | 22 | @implementation ViewController 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | 27 | #pragma mark - test for cm_modelWithDict1 28 | // NSDictionary *dict = @{ 29 | // @"iconStr":@"小明", 30 | // @"showStr":@"这是我的第一条心情" 31 | // }; 32 | // PersonModel *testPerson = [PersonModel cm_modelWithDict1:dict]; 33 | // // 测试数据 34 | // NSLog(@"%@",testPerson); 35 | 36 | 37 | #pragma mark - test for NSObject+EnumDict 38 | // 解析Plist文件 39 | NSString *filePath = [[NSBundle mainBundle] pathForResource:@"statuses.plist" ofType:nil]; 40 | NSDictionary *statusDict = [NSDictionary dictionaryWithContentsOfFile:filePath]; 41 | 42 | // 获取字典数组 43 | NSArray *dictArr = statusDict[@"statuses"]; 44 | NSMutableArray *statusArr = [NSMutableArray array]; 45 | 46 | // 遍历字典数组 47 | for (NSDictionary *dict in dictArr) { 48 | 49 | Status *status = [Status cm_modelWithDict:dict]; 50 | 51 | [statusArr addObject:status]; 52 | } 53 | NSLog(@"%@",statusArr); 54 | 55 | 56 | #pragma mark - test for NSObject+EnumArr 57 | // // 解析Plist文件 58 | // NSString *filePath = [[NSBundle mainBundle] pathForResource:@"statuses.plist" ofType:nil]; 59 | // NSDictionary *statusDict = [NSDictionary dictionaryWithContentsOfFile:filePath]; 60 | // 61 | // // 获取字典数组 62 | // NSArray *dictArr = statusDict[@"statuses"]; 63 | // _statuses = [NSMutableArray array]; 64 | // 65 | // // 遍历字典数组 66 | // for (NSDictionary *dict in dictArr) { 67 | // 68 | // Status *status = [Status modelWithDict:dict]; 69 | // 70 | // [_statuses addObject:status]; 71 | // } 72 | // 73 | // NSLog(@"%@",_statuses); 74 | 75 | } 76 | 77 | 78 | - (void)didReceiveMemoryWarning { 79 | [super didReceiveMemoryWarning]; 80 | // Dispose of any resources that can be recreated. 81 | } 82 | 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /DictToModelDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DictToModelDemo 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DictToModelDemo/statuses.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | statuses 6 | 7 | 8 | title 9 | 标题字符串 10 | person 11 | 12 | iconStr 13 | 头像字符串 14 | showStr 15 | 心情字符串 16 | 17 | cellMdlArr 18 | 19 | 20 | stateStr 21 | 状态字符串 22 | partnerStr 23 | 合作方字符串 24 | 25 | 26 | stateStr 27 | 状态字符串 28 | partnerStr 29 | 合作方字符串 30 | 31 | 32 | stateStr 33 | 状态字符串 34 | partnerStr 35 | 合作方字符串 36 | 37 | 38 | 39 | 40 | title 41 | 标题字符串 42 | person 43 | 44 | iconStr 45 | 头像字符串 46 | showStr 47 | 心情字符串 48 | 49 | cellMdlArr 50 | 51 | 52 | stateStr 53 | 状态字符串 54 | partnerStr 55 | 合作方字符串 56 | 57 | 58 | stateStr 59 | 状态字符串 60 | partnerStr 61 | 合作方字符串 62 | 63 | 64 | stateStr 65 | 状态字符串 66 | partnerStr 67 | 合作方字符串 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /DictToModelDemoTests/DictToModelDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DictToModelDemoTests.m 3 | // DictToModelDemoTests 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DictToModelDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DictToModelDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DictToModelDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DictToModelDemoUITests/DictToModelDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DictToModelDemoUITests.m 3 | // DictToModelDemoUITests 4 | // 5 | // Created by ChenMan on 2018/5/8. 6 | // Copyright © 2018年 cimain. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DictToModelDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DictToModelDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DictToModelDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DictToModelDemo 2 | iOS开发·runtime+KVC实现多层字典模型转换(多层数据:模型嵌套模型,模型嵌套数组,数组嵌套模型) 3 | 4 | # 了解更多 5 | 6 | 简书地址:[iOS开发·runtime+KVC实现多层字典模型转换(多层数据:模型嵌套模型,模型嵌套数组,数组嵌套模型)](https://www.jianshu.com/p/885b65688b96) 7 | --------------------------------------------------------------------------------