Skip to content
A library to make creating autolayout constraints for multiple related views simpler and more elegant. [Swift 4, iOS 9+]
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Neatly.xcodeproj
Neatly
NeatlyExample
NeatlyTests
.gitignore
Cartfile.private
Cartfile.resolved
LICENSE
Neatly.podspec
README.md

README.md

Neatly

A library to make creating autolayout constraints for multiple related views simpler and more elegant.

Background

Autolayout APIs are great, as are DSL libs like SnapKit. There are, however, situations where you want to lay views out according to a regular pattern (e.g. in a stack or a grid), where these tools can be a bit heavyweight.

Neatly provides a simple and elegate DSL for laying multiple views out in a regular pattern, using autolayout constraints.

Neatly

How to get it

Carthage

git "DomainGroupOSS/swift-neatly" "0.1.1"    

Cocoapods

pod "SwiftNeatly", "0.1.1" 

Swift Package Manager

//TODO

Usage

See the examples below, or check out the example code.

Stack

container.neatly
    .add(views: subviews)
    .with(format: .stack(
        axis: .vertical,
        spacing: 20,
        insets: insets)
)
container.neatly
    .add(views: subviews)
    .with(format: .stack(
        axis: .horizontal,
        spacing: 20,
        insets: insets)
)

Table

container.neatly
    .add(views: subviews)
    .with(format: .table(
        columns: 3,
        horizontalSpacing: 10,
        verticalSpacing: 10,
        insets: insets)
)
You can’t perform that action at this time.