Latest 1.0.1
Homepage https://github.com/KimDarren/AddWith
License MIT
Platforms ios 8.0, requires ARC
Authors

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.

Latest podspec

{
    "name": "AddWith",
    "version": "1.0.1",
    "summary": "Add subviews with its' subviews.",
    "homepage": "https://github.com/KimDarren/AddWith",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "TAEJUN KIM": "[email protected]"
    },
    "source": {
        "git": "https://github.com/KimDarren/AddWith.git",
        "tag": "1.0.1"
    },
    "source_files": "Sources/AddWith/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0"
    },
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This