Latest 1.0.0
Homepage https://github.com/naftaly/CoreModel
License MIT
Platforms ios 9.0, requires ARC
Authors

CoreModel is a lightweight framework that simplifies the process of converting your data to usable objects. The API allows you to quickly get data from anywhere and bring it into your app as instances of your objects.

Installation

CoreModel is available on CocoaPods. Just add the following to your project Podfile:

pod 'CoreModel'

Usage

First include it using the following import:

#import <CoreModel/CoreModel.h>

Find yourself some data from somewhere. Let’s use some JSON data as this is the default handled by CoreModel:

{ "firstName": "Alex", "lastName": "Cohen", "profession": "Developer", "age", 37, "married" : NO }

Create a subclass of CMModel, let’s call it Person:

 @interface Person : CMModel

 @property (strong) NSString* firstName;
 @property (strong) NSString* lastName;
 @property (strong) NSString* gender;
 @property (strong) NSString* profession;
 @property (assign) NSUInteger age;
 @property (assign) BOOL married;

 @end

 @implementation Employee
 @end

Then just load it up:

 Person* person = [[Person alloc] initWithData:data error:nil];

You now have a fully initialized instance of person filled in with your data.

License

CoreModel is released under a MIT License. See LICENSE file for details.

Latest podspec

{
    "name": "CoreModel",
    "version": "1.0.0",
    "homepage": "https://github.com/naftaly/CoreModel",
    "source": {
        "git": "https://github.com/naftaly/CoreModel.git",
        "tag": "1.0.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Lightweight framework that simplifies the process of converting your data to usable objects.",
    "social_media_url": "https://twitter.com/naftaly",
    "authors": {
        "Alexander Cohen": "[email protected]"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "9.0"
    },
    "source_files": [
        "CoreModel/CMModel.?",
        "CoreModel/CoreModel.h"
    ],
    "public_header_files": [
        "CoreModel/CMModel.h",
        "CoreModel/CoreModel.h"
    ]
}

Pin It on Pinterest

Share This