测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可协议 | MIT |
发布上次发布 | 2017年6月 |
SwiftSwift版本 | 3.0 |
SPM支持SPM | ✗ |
由houmanager维护。
YJExtensions 常用扩展
##示例:由颜色生成图片
/// 颜色生成图片
public static func yj_createImage(_ color: UIColor) -> UIImage? {
let rect = CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0)
UIGraphicsBeginImageContext(rect.size)
let context = UIGraphicsGetCurrentContext()
context?.setFillColor(color.cgColor)
context?.fill(rect)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image ?? nil
}