测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2016年12月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
Maintained by Reo Hokazono.
TrueScale 将实际单位转换为 CGRect, CGsize, CGPoint。
let frame = TSRect(x: 10, y: 10, width: 20, height: 20, unit: .mm).cgrect
let square = UIView(frame: frame)
square.backgroundColor = UIColor.darkGray
//[cm]
let frame = TSRect(x: 1, y: 1, width: 2, height: 2, unit: .cm).cgrect
//[inch]
let frame = TSRect(x: 1, y: 1, width: 2, height: 2, unit: .inch).cgrect
let size = TSSize(width: 30, height: 30, unit: .mm)
let point = TSPoint(x: 1, y: 1, unit: .inch)
let pointValue = CGFloat(1).toPoint(unit: .cm)
iOS 模拟器、watchOS、tvOS 和 macOS 不受支持。
将 TrueScale.Swift
添加到您的项目中。
TrueScale 在 MIT 许可下发布。有关详细信息,请参阅 LICENSE。