AddWith
概览
添加 带有它的子视图的滚动视图。
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)
安装
-
pod 'AddWith'
许可协议
AddWith 使用 MIT 许可。更多信息请参见 LICENSE 文件。