V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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
expkzb
V2EX  ›  iDev

对于 iOS 应用来说,你倾向于用哪种方式控制样式

  •  
  •   expkzb · Aug 7, 2015 · 3082 views
    This topic created in 3916 days ago, the information mentioned may be changed or developed.

    一、宏

    类似于:

    #define FontTypeSmallTitle [UIFont fontWithName:@"Arial" size:14]
    

    二、继承

    类似于:

    @interface TypeALabel : UILabel
    

    三、使用类似 css 样式表写法的类库

    欢迎补充

    13 replies    2015-10-04 11:09:53 +08:00
    pengjay
        1
    pengjay  
       Aug 7, 2015   ❤️ 1
    Category
    vulgur
        2
    vulgur  
       Aug 7, 2015   ❤️ 1
    继承
    SeanChense
        3
    SeanChense  
       Aug 7, 2015 via iPhone   ❤️ 1
    像 font 、color 这样的直接 Category
    tigerZhang
        4
    tigerZhang  
       Aug 7, 2015
    Category
    xi_lin
        5
    xi_lin  
       Aug 7, 2015
    @SeanChense 怎么用Category做呢?
    hdbean
        6
    hdbean  
       Aug 8, 2015
    分类
    SeanChense
        7
    SeanChense  
       Aug 8, 2015 via iPhone
    @xi_lin http://seanchense.github.io/blog/use_category_in_ios_project.html 我写的一点说明,如有漏洞请见谅。
    LINAICAI
        8
    LINAICAI  
       Aug 8, 2015
    绝对Category好用。。。
    xi_lin
        9
    xi_lin  
       Aug 8, 2015 via iPhone
    @SeanChense 懂了,理解叉了~谢谢分享
    fhefh
        10
    fhefh  
       Aug 8, 2015
    学习了 谢谢
    likers
        11
    likers  
       Aug 12, 2015
    @SeanChense 可以理解为是重载UIColor吗
    SeanChense
        12
    SeanChense  
       Aug 12, 2015
    @likers Category 不能算重载因为不是继承。
    likers
        13
    likers  
       Oct 4, 2015
    @SeanChense 了解了,谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3760 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 04:32 · PVG 12:32 · LAX 21:32 · JFK 00:32
    ♥ Do have faith in what you're doing.