AddWith 1.1.1

AddWith 1.1.1

测试测试通过
Lang语言 SwiftSwift
许可证 MIT
发布上次发布2019年12月
SPM支持 SPM

KimDarren 维护。



AddWith 1.1.1

  • 作者:
  • TAEJUN KIM

AddWith

Swift CocoaPods

🔌使用它的子视图添加子视图。一目了然地查看子视图层次结构。

概览

添加 带有它的子视图的滚动视图。

self.view.add(
  self.scrollView.with(
    self.contentContainer.with(
      self.descriptionLabel
      self.imageView
    )
  ),
  self.backgroundView.with(
    self.backgroundImageView,
    self.logoImageView
  )
)

这相当于

self.view.addSubview(self.scrollView)
self.scrollView.addSubview(self.contentContainer)
self.contentContainer.addSubview(self.descriptionLabel)
self.contentContainer.addSubview(self.imageView)
self.view.addSubview(self.backgroundView)
self.backgroundView.addSubview(self.backgroundImageView)
self.backgroundView.addSubview(self.logoImageView)

小贴士和技巧

  • 您可以使用数组添加子视图。

    let subviews: [UIView] = [button, label, imageView]
    self.view.add(subviews)

安装

许可协议

AddWith 使用 MIT 许可。更多信息请参见 LICENSE 文件。