Giter Site home page Giter Site logo

liangdahong / ldchained Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 38 KB

链式编程**下的链式设置控件属性,「2016年06月」之前的娱乐项目,现在开源出来玩一玩 😄 修感兴趣的可以瞧瞧。

License: MIT License

Objective-C 100.00%
chained chainer chaincode

ldchained's Introduction

链式编程**下的链式设置控件属性

好久「2016年06月」之前的娱乐项目,现在开源出来玩一玩 😄。

  • 我们通常给 UI 控件设置各种属性的时候是这样的:
UILabel *label = [UILabel new];
[self.view addSubview:label];

label.text = @"123";
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor orangeColor];
label.font = [UIFont systemFontOfSize:15];
label.frame = CGRectMake(100, 100, 100, 20);
label.backgroundColor = [UIColor grayColor];
  • 但你可以这样
label.ld_text(@"123")
.ld_textAlignment(NSTextAlignmentCenter)
.ld_textColor([UIColor orangeColor])
.ld_font([UIFont systemFontOfSize:15])
.ld_frame(CGRectMake(100, 100, 100, 20))
.ld_backgroundColor([UIColor grayColor]);
  • 或者这样
label.ld_text(@"123").ld_textAlignment(NSTextAlignmentCenter).ld_textColor([UIColor orangeColor]).ld_font([UIFont systemFontOfSize:15]).ld_frame(CGRectMake(100, 100, 100, 20)).ld_backgroundColor([UIColor grayColor]);
  • 或者这样
label._._._.ld_tag(1);
UIButton *button = [UIButton new];
button.ld_title(@"1",1).ld_titleShadowColor([UIColor redColor],1).ld_attributedTitle(nil,1);

label.ld_x(100);
label.ld_y(100);
label.ld_origin(CGPointMake(0, 0));
label.ld_size(CGSizeMake(100, 100));
label.ld_x(100).ld_width(100).ld_height(100);
label.ld_x(100).ld_y(0).ld_width(100).stop.ld_height(100);

ldchained's People

Contributors

liangdahong avatar

Watchers

 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.