Skip to content

🔌 ADD subviews WITH its' subviews. Expect subviews' hierarchy at a look.

License

Notifications You must be signed in to change notification settings

KimDarren/AddWith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

🔌 ADD subviews WITH its' subviews. Expect subviews' hierarchy at a look.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published