Latest 0.1.3
Homepage https://github.com/jey-song/model
License MIT
Platforms osx , ios , tvos , watchos , requires ARC
Authors

json string, data <==> model; http json api ==> model <==> local db

usage

  • Cocoapod
  pod 'JSModel', '~>0.1.0'
  • Source
  JSModel.m
  JSModel.h
  • Demo
import UIKit

class Home: JSModel {
    var address: String?
    var rooms_count: NSNumber?
    //var owner: User?
    var rooms_name: [String]?
}
    NSString *json_h = [NSString stringWithFormat:
    @"{
        "address": "beijing chaoyang sanlitun",
        "rooms_count": 3,
        "owner": %@,
        "rooms_name": [
                       "room_01",
                       "room_02",
                       "room_03"
                       ]
    }", json];

    Home *home = [Home modelFromJSONString:json_h];

LICENSE

MIT

Latest podspec

{
    "name": "JSModel",
    "version": "0.1.3",
    "summary": "JSModel is base model  model>. Use key-value coding",
    "description": "JSModel is base model  model>. Use key-value coding"",
    "homepage": "https://github.com/jey-song/model",
    "license": "MIT",
    "authors": {
        "jey song": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jey-song/model.git",
        "tag": "0.1.3"
    },
    "source_files": "JSModel.*",
    "requires_arc": true,
    "platforms": {
        "osx": null,
        "ios": null,
        "tvos": null,
        "watchos": null
    }
}

Pin It on Pinterest

Share This