AddWith 1.1.1

AddWith 1.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2019
SPMSupports SPM

Maintained by KimDarren.



AddWith 1.1.1

  • By
  • TAEJUN KIM

AddWith

Swift CocoaPods

🔌 Add subviews with its' subviews. Expect subviews' hierarchy at a look.

At a Glance

Add scroll view with it's subviews.

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

This is equivalent to:

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)

Tips and Tricks

  • You can add subviews with array.

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

Installation

License

AddWith is under MIT license. See the LICENSE file for more info.