All Projects → lionheart → SuperLayout

lionheart / SuperLayout

Licence: Apache-2.0 License
SuperLayout is a Swift library that makes using Auto Layout a breeze.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to SuperLayout

Easypeasy
Auto Layout made easy
Stars: ✭ 1,877 (+3509.62%)
Mutual labels:  auto-layout
postfixadmin-cookbook
Chef cookbook to install and configure PostfixAdmin.
Stars: ✭ 13 (-75%)
Mutual labels:  apache2
mod fastcgi
FastCGI.com mod_fastcgi apache 2 module fork from http://repo.or.cz/mod_fastcgi.git + last SNAP-0910052141 snapshot
Stars: ✭ 23 (-55.77%)
Mutual labels:  apache2
kafka-elk-docker-compose
Deploy ELK stack and kafka with docker-compose
Stars: ✭ 78 (+50%)
Mutual labels:  apache2
api-server
OpenSCRM是一套基于Go和React的高质量企业微信私域流量管理系统 。遵守Apache2.0协议,全网唯一免费商用。企业微信、私域流量、SCRM。
Stars: ✭ 981 (+1786.54%)
Mutual labels:  apache2
mod authnz jwt
An authentication module for Apache httpd using JSON Web Tokens
Stars: ✭ 74 (+42.31%)
Mutual labels:  apache2
Typo3 Docker Boilerplate
🍲 TYPO3 Docker Boilerplate project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
Stars: ✭ 240 (+361.54%)
Mutual labels:  apache2
spring-security-passwordless
Passwordless authentication example application using Spring Boot and Spring Security
Stars: ✭ 112 (+115.38%)
Mutual labels:  apache2
datastation
App to easily query, script, and visualize data from every database, file, and API.
Stars: ✭ 2,519 (+4744.23%)
Mutual labels:  apache2
docker-compose-moodle
This project quickly builds a local workspace for Moodle (Apache2, PHP-FPM with XDEBUG y Postgres) using containers for each of its main components. The local workspace is built and managed by Docker Compose
Stars: ✭ 33 (-36.54%)
Mutual labels:  apache2
docker-iot-dashboard
A complete IoT server for LoRaWAN IoT projects: node-red + influxdb + grafana + ssl + let's encrypt using docker-compose.
Stars: ✭ 79 (+51.92%)
Mutual labels:  apache2
aem-dispatcher-experiments
Experiments to demonstrate the impact of the Dispatcher and it's configuration parameters.
Stars: ✭ 41 (-21.15%)
Mutual labels:  apache2
OpenSearch
🔎 Open source distributed and RESTful search engine.
Stars: ✭ 5,585 (+10640.38%)
Mutual labels:  apache2
Swiftrichstring
👩‍🎨 Elegant Attributed String composition in Swift sauce
Stars: ✭ 2,744 (+5176.92%)
Mutual labels:  auto-layout
wwlayout
Swifty DSL for programmatic Auto Layout in iOS
Stars: ✭ 46 (-11.54%)
Mutual labels:  auto-layout
Bonmot
Beautiful, easy attributed strings in Swift
Stars: ✭ 3,182 (+6019.23%)
Mutual labels:  auto-layout
cie-cns-apache-docker
L'obiettivo di questo progetto è quello di fornire un template pronto all'uso che realizza un sistema di autenticazione tramite la Smart Card TS-CNS (o CNS) e la CIE (Carta d'Identità Elettronica) basato su Apache HTTP. Ognuno può poi modificare o specializzare questo progetto sulla base delle proprie esigenze Si tratta di un progetto docker per…
Stars: ✭ 48 (-7.69%)
Mutual labels:  apache2
vhost-gen
Configurable vHost generator for Apache 2.2, Apache 2.4 and Nginx
Stars: ✭ 111 (+113.46%)
Mutual labels:  apache2
salesforce-plantuml
Salesforce app to generate UML class & ER-diagrams from your org data. Leverages the PlantUML library.
Stars: ✭ 89 (+71.15%)
Mutual labels:  auto-layout
yantra
JavaScript Engine for .NET Standard
Stars: ✭ 32 (-38.46%)
Mutual labels:  apache2

CI Status Version License Platform

SuperLayout is a library that adds a few custom operators to Swift that makes using the amazing NSLayoutAnchor API for Auto Layout a breeze. SuperLayout doesn't override already-defined methods in Equatable (such as == and >=), and defines ones that are logical and easily understandable to anyone who might be inheriting your codebase or joining your team.

What It Does

In short, SuperLayout turns this:

Into this:

How it works

SuperLayout defines three custom operators: ~~, ≥≥, and ≤≤ that correspond to equalTo, to greaterThanOrEqualTo, and to lessThanOrEqualTo, respectively.

The greater than and less than operators were chosen with practicality in mind; and have simple keyboard shortcuts (just Option + < and Option + > in macOS), so there's no need to copy-paste characters when writing constraints.

Installation

SuperLayout is available via CocoaPods and SwiftPM. If you're using CocoaPods, just specify this in your Podfile:

pod 'SuperLayout'

Before You Use

To use this library, you should have a basic understanding of the NSLayoutAnchor API. If not, read up, and then check out the documentation below to get started.


NSLayoutConstraint Reference

Note: SuperLayout does not (yet) automatically turn off translatesAutoresizingMaskIntoConstraints for the views you'd like to manage with Auto Layout. Disabling this setting automatically is too magical for me. Feel free to create an issue if you disagree.

constraint(equalTo:)viewA.rightAnchor ~~ viewB.leftAnchor

Original
viewA.rightAnchor.constraint(equalTo: viewB.leftAnchor).isActive = true

constraint(equalTo:constant:)viewA.rightAnchor ~~ viewB.leftAnchor + C

Original
viewA.rightAnchor.constraint(equalTo: viewB.leftAnchor, constant: C).isActive = true

constraint(greaterThanOrEqualTo:)viewA.rightAnchor ≥≥ viewB.leftAnchor

Original
viewA.rightAnchor.constraint(greaterThanOrEqualTo: viewB.leftAnchor).isActive = true

constraint(greaterThanOrEqualTo:constant:)viewA.rightAnchor ≥≥ viewB.leftAnchor + C

Original
viewA.rightAnchor.constraint(greaterThanOrEqualTo: viewB.leftAnchor, constant: C).isActive = true

constraint(lessThanOrEqualTo:)viewA.rightAnchor ≤≤ viewB.leftAnchor

Original
viewA.rightAnchor.constraint(lessThanOrEqualTo: viewB.leftAnchor).isActive = true

constraint(lessThanOrEqualTo:constant:)viewA.rightAnchor ≤≤ viewB.leftAnchor + C

Original
viewA.rightAnchor.constraint(lessThanOrEqualTo: viewB.leftAnchor, constant: C).isActive = true

NSLayoutDimension Reference

constraint(equalTo:multiplier:)viewA.heightAnchor ~~ viewB.heightAnchor * M

Original
viewA.heightAnchor.constraint(equalTo: viewB.heightAnchor, multiplier: M).isActive = true

constraint(equalTo:multiplier:constant:)viewA.heightAnchor ~~ viewB.heightAnchor * M + C

Original
viewA.heightAnchor.constraint(equalTo: viewB.heightAnchor, multiplier: M, constant: C).isActive = true

constraint(equalToConstant:)viewA.heightAnchor ~~ C

Original
viewA.heightAnchor.constraint(equalToConstant: C).isActive = true

constraint(greaterThanOrEqualTo:multiplier:)viewA.heightAnchor ≥≥ viewB.heightAnchor * M

Original
viewA.heightAnchor.constraint(greaterThanOrEqualTo: viewB.heightAnchor, multiplier: M).isActive = true

constraint(greaterThanOrEqualTo:multiplier:constant:)viewA.heightAnchor ≥≥ viewB.heightAnchor * M + C

Original
viewA.heightAnchor.constraint(greaterThanOrEqualTo: viewB.heightAnchor, multiplier: M, constant: C).isActive = true

constraint(greaterThanOrEqualToConstant:)viewA.heightAnchor ≥≥ C

Original
viewA.heightAnchor.constraint(greaterThanOrEqualToConstant: C).isActive = true

constraint(lessThanOrEqualTo:multiplier:)viewA.heightAnchor ≤≤ viewB.heightAnchor * M

Original
viewA.heightAnchor.constraint(lessThanOrEqualTo: viewB.heightAnchor, multiplier: M).isActive = true

constraint(lessThanOrEqualTo:multiplier:constant:)viewA.heightAnchor ≤≤ viewB.heightAnchor * M + C

Original
viewA.heightAnchor.constraint(lessThanOrEqualTo: viewB.heightAnchor, multiplier: M, constant: C).isActive = true

constraint(lessThanOrEqualToConstant:)viewA.heightAnchor ≤≤ C

Original
viewA.heightAnchor.constraint(lessThanOrEqualToConstant: C).isActive = true

License

SuperLayout is available under the Apache 2.0 license. See LICENSE for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].