RGCategory
框架主要封装了iOS中常用控件的快捷创建方法以及常用功能的快捷实现方法
UI示例
UI布局创建的代码位于“Extension_MAS”文件目录下,包括“UIButton”、“UILabel”、“UICollectionView”、“UIImageView”、“UITableView”、“UIView”等常用控件布局
一行代码创建 button
UIButton *testBtn = [UIButton ButtonWithNormalTitle:@"测试" NormalTitleColor:[UIColor redColor] FontSize:14 backgroundColor:[UIColor grayColor] supView:self.view buttonMas:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(100);
make.top.mas_equalTo(100);
make.width.height.mas_equalTo(50);
}];
一行代码创建 label
UILabel *testLbl = [UILabel LableWithText:@"测试" textColor:[UIColor blueColor] FontSize:15 supView:self.view lableMas:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(200);
make.top.mas_equalTo(100);
}];
常用功能示例
一行代码字符串转日期
NSDate *date = [NSDate dateWithString:@"2019-01-19" dateFormat:@"yyyy-MM-dd"];
设置下划线
testLbl.attributedText = [@"测试" deleteAttributedString];
安装方法
RGCategory 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'RGCategory'
期待
如果在使用过程中遇到BUG,希望你能Issues我,谢谢
作者
[email protected], [email protected]
授权协议
RGCategory支持MIT授权协议。更多详情请参阅LICENSE文件。