Latest 1.1.0
Homepage https://github.com/SugarAndCandy/SuperPuperDuperLayout
License MIT
Platforms ios 8.0
Authors

SuperPuperDuperLayout

Lightweight, elegant and safe wrapper over auto layout.

Inspired by Layout Anchors and SnapKit.

Without overheads such as «extension UIView», «extension UILayoutGuide», «objc_setAssociatedObjectAssociatedObject», «objc_getAssociatedObject» etc.

CocoaPods
CocoaPods
CocoaPods

Contents

For example

Layout Anchors

By using Layout Anchors it would be as below

class ViewController: UIViewController {
    private lazy var someView = UIView()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(someView)
        someView.translatesAutoresizingMaskIntoConstraints = false
        someView.heightAnchor.constraint(equalToConstant: 30).isActive = true
        someView.widthAnchor.constraint(equalToConstant: 30).isActive = true
        someView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
        someView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
    }
}

But if you support iOS 8 everything becomes worse, because of NSLayoutConstraint(item:attribute:relatedBy:blah:blah:blah:blah)

SuperPuperDuperLayout

You may use "SuperPuperDuperLayout" like this

import SuperPuperDuperLayout

class ViewController: UIViewController {
    private lazy var someView = UIView()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(someView)
        Layout.to(someView) {
            $0.size.equal.value(.init(width: 30, height: 30))
            $0.center.equalToSuperview.value(.zero)
        }
    }
}

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.4.0+ is required to build SuperPuperDuperLayout 1.0.0.

To integrate SuperPuperDuperLayout into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target 'TargetName' do
    pod 'SuperPuperDuperLayout'
end

Then, run the following command:

$ pod install

Requirements

  • iOS 8.0+
  • Xcode 9.0+
  • Swift 4.1+

Credits

License

SuperPuperDuperLayout is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "SuperPuperDuperLayout",
    "version": "1.1.0",
    "license": "MIT",
    "summary": "Lightweight, elegant and safe wrapper over auto layout.",
    "description": "Lightweight, elegant and safe wrapper over auto layout. Inspired by Layout Anchors ( https://developer.apple.com/documentation/uikit/nslayoutanchor ) and SnapKit ( https://github.com/SnapKit/SnapKit ). Without overheads such as u00abextension UIViewu00bb, u00abextension UILayoutGuideu00bb, u00abobjc_setAssociatedObjectAssociatedObjectu00bb, u00abobjc_getAssociatedObjectu00bb etc.",
    "homepage": "https://github.com/SugarAndCandy/SuperPuperDuperLayout",
    "authors": {
        "Alexander Zolotarev": "[email protected]"
    },
    "social_media_url": "https://twitter.com/zolotarev_s",
    "source": {
        "git": "https://github.com/SugarAndCandy/SuperPuperDuperLayout.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/**/*.swift",
    "swift_version": "4.1"
}

Pin It on Pinterest

Share This