AutoLayout Micro DSL SPM from Chris Eidhof's article

Overview

EasyAutoLayout

Swift Package Manager compatible

Intro

EasyAutoLayout is a small framework built using the ideas presented in the article called Autolayout Micro DSL by Chris Eidhof.

I like to use this on most of my projects, it uses very little code and is a fast way to work with view coding without all the autolayout boiler plate and without having to add big external dependencies.

Usage:

    import EasyAutoLayout
    
    let view = UIView()
    let label = UILabel()
    view.addSubview(label, constraints: [
       equal(\.leadingAnchor),
       equal(\.topAnchor, \.safeAreaLayoutGuide.topAnchor),
       equal(\.trailingAnchor)
    ])
    

Check the original article for more usages and code explanation.

Swift Package Manager

Note: Instructions below are for using SwiftPM without the Xcode UI. It's the easiest to go to your Project Settings -> Swift Packages and add it from there.

To integrate using Apple's Swift package manager, without Xcode integration, add the following as a dependency to your Package.swift:

.package(url: "https://github.com/garrefa/EasyAutoLayout.git")

and then specify "EasyAutoLayout" as a dependency of the Target in which you wish to use it.

You might also like...
The fast path to autolayout views in code
The fast path to autolayout views in code

NorthLayout The fast path to autolayout views in code Talks https://speakerdeck.com/banjun/auto-layout-with-an-extended-visual-format-language at AltC

🏗 MondrianLayout - describing structured layout for AutoLayout
🏗 MondrianLayout - describing structured layout for AutoLayout

🏗 A DSL based layout builder for AutoLayout

An awesome Swift CSS DSL library using result builders.

An awesome Swift CSS DSL library using result builders.

This
This "Calculator" application is a simple one screen design of calculator screen i have made this single screen design application just to practice AutoLayout concepts.

Calculator Layout This "Calculator" application is a simple one screen design of calculator screen i have made this single screen design application j

Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout

Masonry Masonry is still actively maintained, we are committed to fixing bugs and merging good quality PRs from the wider community. However if you're

A bit of steroids for AutoLayout, powered by Swift.

AutoLayoutPlus AutoLayoutPlus is a Swift library consisting in a set of extensions to help dealing with Auto Layout programatically. With AutoLayoutPl

Yet Another Swift Auto Layout DSL
Yet Another Swift Auto Layout DSL

FormationLayout Documentation FormationLayout is the top level layout class for one root view. FormationLayout takes a UIView as its rootView. transla

An autolayout library for the damn fine citizens of San Diego.
An autolayout library for the damn fine citizens of San Diego.

Anchorman Do you think autolayout has to be hard? Nah. NSLayoutAnchor is pretty neat! But it's still a bit tedious of an API. Try writing .translatesA

Minimal AutoLayout convenience layer. Program constraints succinctly.

MiniLayout Minimal AutoLayout convenience layer. Program constraints succinctly. Usage Put label over textField // using MiniLayout: view.constrain(la

Owner
Alexandre Garrefa
iOS developer. Interested in OSS, swift, js, node and others.
Alexandre Garrefa
MisterFusion is Swift DSL for AutoLayout. It is the extremely clear, but concise syntax, in addition, can be used in both Swift and Objective-C. Support Safe Area and Size Class.

MisterFusion MisterFusion makes more easier to use AutoLayout in Swift & Objective-C code. Features Simple And Concise Syntax Use in Swift and Objecti

Taiki Suzuki 316 Nov 17, 2022
A Swift Autolayout DSL for iOS & OS X

SnapKit is a DSL to make Auto Layout easy on both iOS and OS X. ⚠️ To use with Swift 4.x please ensure you are using >= 4.0.0 ⚠️ ⚠️ To use with Swift

null 19.1k Jan 2, 2023
Tiny Swift DSL for Autolayout

SwiftAutoLayout SwiftAutoLayout is a tiny DSL for Autolayout intended to provide a more declarative way to express layout constraints. Here's a quick

Indragie Karunaratne 657 Sep 18, 2022
SwiftLayout - View hierarchy and autolayout DSL library

SwiftLayout view hierarchy and autolayout DSL library goal 뷰의 계층구조와 constraint 관

iOS Swifty Krew 104 Dec 28, 2022
Write concise Autolayout code

Winner of Hacking with Swift Recommended award You + Stevia = ?? ?? Write concise, readable layouts ?? Reduce your maintenance time ?? Compose your st

Fresh 3.3k Jan 6, 2023
A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:

Cartography ?? ?? Using Cartography, you can set up your Auto Layout constraints in declarative code and without any stringly typing! In short, it all

Robb Böhnke 7.3k Jan 4, 2023
📱AutoLayout can be set differently for each device

DeviceLayout DeviceLayout is a Swift framework that lets you set Auto Layout constraints's differently for each device Using only IBInspector of Xcode

Cruz 171 Oct 11, 2022
An easier and faster way to code Autolayout

EZAnchor 中文介绍 An easier way to code Autolayout Are you annoyed of coding .active = true while using Autolayout Anchors over and over again? Are you an

Alex.Liu 25 Feb 20, 2022
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.

KVConstraintKit KVConstraintKit is a DSL to make easy & impressive Auto Layout constraints on iOS, tvOS & OSX with Swift Installation Using CocoaPods

Keshav Vishwkarma 90 Sep 1, 2022
A compact but full-featured Auto Layout DSL for Swift

Mortar allows you to create Auto Layout constraints using concise, simple code statements. Use this: view1.m_right |=| view2.m_left - 12.0 Instead of:

Jason Fieldman 83 Jan 29, 2022