Giter Site home page Giter Site logo

dpcategory's Introduction

DPCategory

UI分类,包含了分类方法和链式语法,参考借鉴了ZZFLEXDemo和YYCategory。

可以通过:

UILabelCreate()
.makeChain
.addToSuperView(self.view)
.backgroundColor([UIColor grayColor])
//如果项目导入masonry的话
//    .makeMasonry(^(MASConstraintMaker * _Nonnull make) {
//        make.top.mas_offset(16);
//        make.centerX.equalTo(self.contentView);
//        make.width.height.mas_equalTo(100);
//    })
.assignTo(^(__kindof UIView * _Nonnull view) {
self.label = view;
});

很方便的设置Label属性或其他控件属性。

它可以:

  1. 完美的符合NSObject的继承体系,不同控件只会拥有自己继承体系中的方法。如果可以的话,可以方便的扩展方法。
  2. 链式风格,可以清楚的了解到控件设置到加载的全过程,方便复制和修改,更快的创建UI。
  3. 控件由单独model执行设置方法,非常安全。

iOS OC项目优化之路(一)之UIKit篇

已支持cocopods,

pod 'DPCategory'

dpcategory's People

Contributors

holyle avatar

Stargazers

山野浪浪 avatar Hou 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.