Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance 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

Contributors

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /