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

sam-w/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

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

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

  • Swift 94.2%
  • Ruby 5.4%
  • Objective-C 0.4%