Skip to content

A library to make creating autolayout constraints for multiple related views simpler and more elegant. [Swift 4, iOS 9+]

License

Notifications You must be signed in to change notification settings

DomainGroupOSS/swift-neatly

Repository files navigation

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

Swift Package Manager

.package(url: "https://github.com/DomainGroupOSS/swift-neatly", from: "0.4.0")

Usage

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)
)

About

A library to make creating autolayout constraints for multiple related views simpler and more elegant. [Swift 4, iOS 9+]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages