创造者 0.1.3

创造者 0.1.3

测试已测试
语言语言 Objective-CObjective C
许可证 MIT
发布最新发布2017年9月

Bartholomewo维护。



创造者 0.1.3

  • Bartholomewo

安装

pod 'Maker'

作者

Bartholomewo, [email protected]

更新

版本 更新
0.13 增加UITableView,增加com_backgroundColor2
0.12 去除UITextField的通知
0.11 增加UITextField的字符限制,控制功能
0.10 发布版本

创造者介绍

创造者是一个使用链式语法实现UIKit控件的小型框架,学习后可以快速实现UI控件开发。

目前支持的控件:

UIView / UILabel / UIButton / UITextField / UIImageView / UIScrollView / UITableView/

其他控件正在努力开发中。

API介绍

简单使用:
UIView.maker
.com_setup(self.view)
.com_frame(0, 0, 100, 100)

前缀介绍:
UIView通用:com_
UILabel: lab_
UIButton: btn_
UITextField: tf_
UIScrollView: scr_
UIImageView: img_
UITableView: tab_

比较(使用Maker能减少大量代码量,并且更直观易懂)

UILabel *label = [[UILabel alloc] init];
label.frame = CGRectMake(20, 40, 100, 40);
label.layer.cornerRadius = 10;
label.layer.masksToBounds = YES;
label.layer.borderColor = [MakerUntil colorWithHexString:@"#C3342E"].CGColor;
label.layer.borderWidth = 2;
label.text = @"Center";
label.textColor = [MakerUntil colorWithHexString:@"#C3342E"];
label.font = [UIFont systemFontOfSize:17 weight:0];
label.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:label];

UILabel *label = UILabel.maker
.com_setup(self.view)
.com_frame(20, 40, 100 ,40)
.com_cornerRadius(10)
.com_border(2, @"#C3342E")
.com_backgroundColor(@"#F1F1F1")
.lab_text(@"Center")
.lab_textColor(@"#C3342E")
.lab_font1(17)
.lab_textAlinment(lCenter);

注意:

1. 在使用Button的点击事件,TextField的ValueChange事件的时候,如果在Block块中使用了self,请在Button上方加入:
__weak typeof(self) weakSelf = self;
解除循环引用

2. UITableView的另一种初始化
_tableView = [UITableView maker:mk_Plain]

如果感觉好用且希望提供更多功能,请联系[email protected],或者提交后提供更好的功能改进。