要运行示例项目,首先克隆仓库,然后从 Example 目录运行 pod install
HXTool 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "HXTool"
1.使用十六进制字符串的 UIColor
self.view.backgroundColor = [UIColor hx_colorWithRGBString:@"4EBDFB"];
或使用 RGB 数字
self.view.backgroundColor = [UIColor hx_colorWithRGBNumber:78 green:189 blue:151];
也可以随机颜色
self.view.backgroundColor = [UIColor hx_randomColor];
2.UIButton
UIButton *button = [UIButton hx_buttonWithTitle:@"button" fontSize:12 normalColor:[UIColor blueColor] selectedColor:[UIColor whiteColor]];
3.屏幕框架
1.Screen Width and Screen Height
view.frame = CGRectMake(100, 300, [UIScreen hx_screenWidth]/2, [UIScreen hx_screenHeight]/6);
4.宏
//App Version
NSLog(@"app version: %@", AppVersion);
5.NSArray
//enumerate objects
[self.array hx_each:^(id obj) {
NSLog(@"%@",obj);
}];
Insofan, [email protected]
HXTool 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。