iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
banxi1988
V2EX  ›  iDev

从 API 到 Model: 我是这样做的

  •  
  •   banxi1988 ·
    banxi1988 · Dec 22, 2016 · 3641 views
    This topic created in 3512 days ago, the information mentioned may be changed or developed.

    今年将原来代码生成脚本重写了下. 思来想去,虽然自己觉得很有用. 但是还是拿出来让大家看看. 独乐乐不如众乐乐.

    开源代码倒比较简单, 只是文档也要跟上才好.

    今天更新了第一个使用示例文档. 从 API 到 Model

    简而言之,做法只是简单的两步.

    1. json to fields
    2. fields to model

    闲话少说, 具体使用说明见:

    https://github.com/banxi1988/iOSCodeGenerator

    [使用动图

    4 replies    2016-12-23 18:04:50 +08:00
    qwer1234asdf
        1
    qwer1234asdf  
       Dec 22, 2016 via iPhone
    像 cakephp 的 model 那样么?
    banxi1988
        2
    banxi1988  
    OP
       Dec 23, 2016
    @qwer1234asdf
    我对 cakephp 不熟悉. 但是应该不是这样的.
    我这是提供速写及转换的手法.
    twoyuan
        3
    twoyuan  
       Dec 23, 2016
    赞,应该和 Android Studio 的 GsonFormat 差不多
    banxi1988
        4
    banxi1988  
    OP
       Dec 23, 2016
    @twoyuan 看了下 GsonFormat 确实差不多.
    不过我没有做成 IDE 插件, 而是添加系统服务的方式使用.
    也没有提供 GUI 界面, 而是直接书写. 提供简写. 使用起来比较方便.
    不过看来我需要添加一个怎么添加 Automator 服务的说明.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4819 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 09:55 · PVG 17:55 · LAX 02:55 · JFK 05:55
    ♥ Do have faith in what you're doing.