优雅的iPhone全尺寸/等比例精准适配工具
Screen增加缩放模式处理, 优化缩放模式判断准确性, 设置条件增加缩放模式值.
"default"
.i35("3.5 inches (iPhone 4, 4s)")
.i40("4.0 inches (iPhone 5, 5s, SE)")
.i47("4.7 inches (iPhone 6, 7, 8)")
.i55("5.5 inches (iPhone 6, 7, 8 Plus)")
.ifull("full screen (iPhone X, Xs, XsMax)")
.i58full("5.8 inches (iPhone X, Xs)")
.i61full("6.1 inches (iPhone XR)")
.i65full("6.5 inches (iPhone XsMax)")
"default".screen
.width(._320, is: "width 320")
.width(._375, is: "width 375")
.height(._844, is: "height 844")
.height(._812, is: "height 812")
.inch(._4_7, is: "4.7 inches")
.inch(._5_8, is: "5.8 inches")
.inch(._6_5, is: "6.5 inches")
.level(.compact, is: "screen 3: 2")
.level(.regular, is: "screen 16: 9")
.level(.full, is: "screen 19.5: 9")
.value
"default"
.i35("3.5 inches (iPhone 4, 4s)")
.i40("4.0 inches (iPhone 5, 5s, SE)")
.i47("4.7 inches (iPhone 6, 7, 8)")
.i55("5.5 inches (iPhone 6, 7, 8 Plus)")
.ifull("full screen (iPhone X, Xs, XsMax)")
.i58full("5.8 inches (iPhone X, Xs)")
.i61full("6.1 inches (iPhone XR)")
.i65full("6.5 inches (iPhone XsMax)")
"default".screen
.set("width 320", for: .width(._320))
.set("width 375", for: .width(._375))
.set("height 844", for: .height(._844))
.set("height 812", for: .height(._812))
.set("4.7 inches", for: .inch(._4_7))
.set("5.8 inches", for: .inch(._5_8))
.set("6.5 inches", for: .inch(._6_5))
.set("screen 3: 2", for: .level(.compact))
.set("screen 16: 9", for: .level(.regular))
.set("screen 19.5: 9", for: .level(.full))
.value
感谢 "米菲酱" 发现这个问题
增加截取浮点类型小数位数扩展, Storyboard相关处理默认改为保留0位小数 (解决引小数引起的多种隐患问题), 代码中可调用的auto()
扩展 依旧保持保留3位小数 (可根据需要调用新增的截取方法使用)
优化自定义转换闭包设置方法 static func set(conversion: @escaping ((Double) -> Double))
,
CGPoint
, CGSize
, CGRect
, CGVector
, UIOffset
, UIEdgeInsets
增加auto()扩展,
UILabel
增加 AutoShadowOffset
属性设置自动适配阴影偏移.