Skip to content

Instantly share code, notes, and snippets.

@BayramInanc
BayramInanc / playground.swift
Created April 16, 2023 15:17 — forked from ftp27/playground.swift
AutoLayout Hugging Priority and Compression Resistance Priority tests
import PlaygroundSupport
import UIKit
func makeLabels(left: String, right: String) -> (UIView, UILabel, UILabel) {
let leftLb: UILabel = {
let label = UILabel(frame: .zero)
label.textAlignment = .left
label.backgroundColor = .blue
label.text = left
return label
@BayramInanc
BayramInanc / AutoLayout.md
Created April 16, 2023 15:16 — forked from chosa91/AutoLayout.md
The best damn AutoLayout guide I've ever seen

ℹ️ This article is also available on his blog.


Fundamentals

Layout and Drawing are two different things:

  • Layout defines only the positions and sizes of all views on screen.
  • Drawing specifies how each view is rendered (how it looks).