Swiftpack.co - Package - jorisvg/layout-equations

LayoutEquations

Layout Equations is a package that makes it easier to create NSLayoutConstraints in code. Constraints can be expressed as simple equations.

Examples

Before:

NSLayoutConstraint.activate([
    view.topAnchor.constraint(equalTo: otherView.bottomAnchor),
    view.bottomAnchor.constraint(lessThanOrEqualTo: parentView.bottomAnchor, constant: -16)
])

After:

NSLayoutConstraint.activate([
    view.topAnchor == otherView.bottomAnchor,
    view.bottomAnchor <= parentView.bottomAnchor - 16
])

Github

link
Stars: 0

Dependencies

Used By

Total: 0