Latest 1.0.0
Homepage https://github.com/JamieREvans/LayoutSwiftly
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

import LayoutSwiftly

private func buildUI()
{
    let redView = self.addViewWithColor(UIColor.redColor())
    let purpleView = self.addViewWithColor(UIColor.purpleColor())
    let greenView = self.addViewWithColor(UIColor.greenColor())

    self.view.alignViewsHorizontally([redView, greenView, purpleView], horizontalSeparations: [50.0, 50.0, -20.0, 20.0], widths: [50.0, 30.0, 0.0])
    self.view.alignViewsVertically([redView, greenView], verticalSeparations: [150.0, 20.0], heights: [50.0, 100.0])
    self.view.alignViewsVertically([redView, purpleView], verticalSeparations: [10.0], heights: [0.0, 50.0])
}

private func addViewWithColor(color: UIColor) -> UIView
{
    let coloredView = UIView()
    coloredView.translatesAutoresizingMaskIntoConstraints = false
    coloredView.backgroundColor = color
    self.view.addSubview(coloredView);

    return coloredView
}

example

Requirements

Installation

LayoutSwiftly is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LayoutSwiftly"

Author

JamieREvans, [email protected]

License

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

Latest podspec

{
    "name": "LayoutSwiftly",
    "version": "1.0.0",
    "summary": "Layout all of your views in one go with Swift and Autolayout",
    "description": "Using visual constraints, LayoutSwiftly allows you to set many constraints all at once. This UIView extention works well with any other Autolayout tool out there, as well.",
    "homepage": "https://github.com/JamieREvans/LayoutSwiftly",
    "license": "MIT",
    "authors": {
        "JamieREvans": "[email protected]"
    },
    "source": {
        "git": "https://github.com/JamieREvans/LayoutSwiftly.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This