GithubHelp home page GithubHelp logo

vaselineee / esjsonformat-xcode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enjoysr/esjsonformat-xcode

0.0 2.0 0.0 3.02 MB

将Json格式化输出为模型的属性

License: MIT License

Objective-C 100.00%

esjsonformat-xcode's Introduction

ESJsonFormat-Xcode

将Json格式化输出为模型的属性

写在之前的注意

  • Json中的key对应的value为Null的话会格式化成NSString类型
  • 格式化之前光标放在你需要添加属性的地方
  • RootClass需要自己手动创建,插件只负责RootClass里面的属性生成

####怎么安装:

方式1:下载-Xcode打开-Command+B-重启Xcode

方式2:通过Alcatraz安装,搜索 ESJsonFormat

方式3:下载-解压plugin文件夹中zip到~/Library/Application Support/Developer/Shared/Xcode/Plug-ins-重启Xcode

####怎么使用:

Window-ESJsonFormat-输入Json-Enter OR 快捷键(Control+Shift+J)-输入Json-Enter

Screenshot

####功能说明:

-0.1

  • 通过Json字符串生成对应属性
  • 通过文件写入的方式生成到.m文件
  • 支持输入嵌套模型名称

-0.2

  • 支持Swift
  • 修复json的value的值为Null的时候多出来的空行
  • 修复BOOL类型值格式化失效问题

####Alcatraz

  • 支持 Alcatraz ,请搜索 ESJsonFormat

Screenshot

####效果: 简单模型

Screenshot

复杂模型

Screenshot

图中的Json格式

{
    "name": "王五",
    "gender": "man",
    "age": 15,
    "height": "140cm",
}
{
    "name": "王五",
    "gender": "man",
    "age": 15,
    "height": "140cm",
    "addr": {
        "province": "fujian",
        "city": "quanzhou",
        "code": "300000"
    },
    "hobby": [
        {
            "name": "billiards",
            "code": "1"
        },
        {
            "name": "computerGame",
            "code": "2"
        }
    ]
}

####计划实现:

  • 生成MJExtension中集合对应的Class的方法
  • 将嵌套模型生成文件

####其他:

  • 如在使用过程中需要到问题,请你Issues我。
  • 有什么好的想法也可以Issues我。
  • 如果你半夜睡不着觉也可以Issues我。

Thanks:GsonFormatVVDocumenter-Xcode

esjsonformat-xcode's People

Contributors

enjoysr avatar

Watchers

James Cloos avatar Jushuang avatar

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.