ProtonomeRoundedViews 1.2.0

ProtonomeRoundedViews 1.2.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2019年8月
SPM支持 SPM

Daniel Clelland 维护。



  • Daniel Clelland

ProtonomeRoundedViews

ProtonomeRoundedViews 是一组具有圆形角的 IBDesignable 兼容视图。

它们以性能为导向构建,并且为了避免设置 layer.cornerRadius,而是使用可调整大小的图像或覆盖 drawRect:。这样做的原因是调用 layer.cornerRadius 会导致图层在 CPU 上渲染其角,如果在滚动视图内部大量执行,这可能会显著降低帧率。

此外,视图支持 IBInspectableIBDesignable 以在 Interface Builder 中进行配置和预览。

✓ UIView -> RoundedView

✓ UILabel -> RoundedLabel

✓ UIButton -> RoundedButton

待办事项

  • 探索只设置 shouldRasterizerasterizationScale
  • 探索在 RoundedLayerRoundedLabel 上使用可调整大小的图像