# roberthein/TinyConstraints

Nothing but sugar.

Repository: https://github.com/roberthein/TinyConstraints
Canonical: https://ross.abutalabs.com/products/tinyconstraints
Language: Swift
License: MIT
License Family: permissive
Topics: auto, layout, swift, constraints, nslayoutconstraints, nslayoutconstraint, animation, superview, center, sugar, stack, swift4, arkit, constraint, sweet, syntactic, library, libraries, swift5, swift-5
Last push: 2024-04-16T15:06:27+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3496, "days_push": 869, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4082, forks 195 (observed 2026-08-28T04:08:34.451955+00:00)

## What it is
TinyConstraints is a Swift library that provides syntactic sugar over NSLayoutConstraint to make Auto Layout code shorter and more readable. It offers one-line helpers like edgesToSuperview() and center(in:) while remaining fully compatible with standard Auto Layout code.

## Use cases
- pin a view to its superview edges with one line of code
- center a view in its superview without verbose anchor code
- stack views together with minimal constraint code
- set constraint priorities and relations concisely
- replace verbose NSLayoutConstraint boilerplate in UIKit apps
- create and store inactive constraints for later activation

## When to choose
- you build UIKit iOS apps and want concise, readable Auto Layout code
- you want a lightweight drop-in wrapper fully compatible with existing NSLayoutConstraint code
- you frequently constrain views to their superview or stack views together

## When to avoid
- you use SwiftUI instead of UIKit Auto Layout
- you prefer explicit NSLayoutConstraint or third-party frameworks like SnapKit with larger ecosystems
- you need a library under very active development, as updates are infrequent

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, animation
- domain: mobile-development, developer-tools
- platform: -
- tags: auto-layout, nslayoutconstraint, syntactic-sugar, uikit, constraints, ios, swift, mobile

## Member repositories
- roberthein/TinyConstraints (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:34.451955+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:23:25.397998+00:00, confidence not recorded.
  - readme: https://github.com/roberthein/TinyConstraints (fetched 2026-08-28T04:08:34.451955+00:00, sha 497070b2bb6d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
