Giter Club home page Giter Club logo

autoparam's Introduction

AutoParam

通过JSON数据,自动转化成OC属性,并且在控制台输出。 根据实际开发中花费大量时间做枯燥乏味且无技术含量的属性定义过程,实在不忍,因此试着用runtime写了一个demo,一行代码解决过去困扰。

#使用方法 //通过传入字典,在控制台输出属性定义过程.

1.  将NSObject+Property.h、NSObject+Property.m,拷贝到项目中,导入头文件 #import "NSObject+Property.h"

2.  直接调用:[NSObject createPropertyCodeWithDict:YourDict];

3.控制台输出:
2016-07-06 16:06:38.724 AutoParam[2290:60710] 
字典中属性转代码:

@property (nonatomic, strong) NSDictionary *friend;

@property (nonatomic, strong) NSArray *friends;

@property (nonatomic, assign) int online;

@property (nonatomic, copy) NSString *name;

@property (nonatomic, assign) BOOL isVIP;

4.将控制台 输出内容 拷贝到对应 模型文件。

#效果演示
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.