{"id":19190851,"url":"https://github.com/tinder/layout","last_synced_at":"2026-03-06T06:17:44.999Z","repository":{"id":222218072,"uuid":"598851689","full_name":"Tinder/Layout","owner":"Tinder","description":"High Fidelity Auto Layout Result Builder Syntax for UIKit","archived":false,"fork":false,"pushed_at":"2026-02-26T02:46:33.000Z","size":3989,"stargazers_count":51,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-26T07:51:49.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://Tinder.github.io/Layout","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tinder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-07T23:40:39.000Z","updated_at":"2026-02-26T02:45:47.000Z","dependencies_parsed_at":"2024-11-09T11:36:19.399Z","dependency_job_id":"ec52c0cb-1a57-42ba-994d-0b7926098c34","html_url":"https://github.com/Tinder/Layout","commit_stats":null,"previous_names":["tinder/layout"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/Tinder/Layout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2FLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2FLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2FLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2FLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tinder","download_url":"https://codeload.github.com/Tinder/Layout/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2FLayout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:36:09.127Z","updated_at":"2026-03-06T06:17:44.957Z","avatar_url":"https://github.com/Tinder.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Swift](https://github.com/Tinder/Layout/actions/workflows/swift.yml/badge.svg?event=push)](https://github.com/Tinder/Layout/actions/workflows/swift.yml)\n\u0026nbsp;\n[![DocC](https://github.com/Tinder/Layout/actions/workflows/docc.yml/badge.svg?event=push)](https://github.com/Tinder/Layout/actions/workflows/docc.yml)\n\u0026nbsp;\n[![Pages](https://github.com/Tinder/Layout/actions/workflows/pages.yml/badge.svg?event=push)](https://github.com/Tinder/Layout/actions/workflows/pages.yml)\n\u0026nbsp;\n[![Artifactory](https://github.com/Tinder/Layout/actions/workflows/artifactory.yml/badge.svg?event=push)](https://github.com/Tinder/Layout/actions/workflows/artifactory.yml)\n\n# Layout\n\nHigh Fidelity Auto Layout Result Builder Syntax for UIKit\n\n## Overview\n\nLayout was introduced into the iOS codebase at Tinder in 2017 and has since been used to programmatically define the screens of the app.\n\nLayout is a wrapper around the Apple platform Auto Layout SDK and provides a less verbose DSL to aid in adoption and ease troubleshooting UI layout issues. Projects with large codebases use this type of programmatic UI code instead of visual WYSIWYG editors (such as Xcode storyboards) to avoid unmanageable merge conflicts that occur in file formats such as XML (the serialized format of Xcode storyboards).\n\nCode written with Layout leverages a high fidelity syntax, meaning it is easy to visualize the UI layout that the code represents. However, Layout does not limit the native Auto Layout capabilities in any way, which can readily be used along with the Layout API. In recent years, mobile platforms have seen the introduction of declarative UI frameworks such as SwiftUI and Jetpack Compose which realize significantly reduced learning curves. While not a declarative framework, Layout utilizes a similar declarative style, in this case for the UIKit framework.\n\n## Minimum Requirements\n\n- iOS `13.0`\n- Swift `5.8`\n\n## Installation\n\n### Swift Package Manager\n\n**Package Dependency**\n\n\u003e Replace `\u003cversion\u003e` with the desired minimum version.\n\n```swift\n.package(url: \"https://github.com/Tinder/Layout.git\", from: \"\u003cversion\u003e\")\n```\n\n**Target Dependencies**\n\nLayout\n\n```swift\n\"Layout\"\n```\n\nSnapshot Testing Extensions _(for test targets)_\n\n```swift\n.product(name: \"SnapshotTestingExtensions\", package: \"Layout\")\n```\n\n### Swift Package Collection\n\n```swift\nhttps://swiftpackageindex.com/Tinder/collection.json\n```\n\n## Usage\n\nThe following example demonstrates adding a label, an image view and a button as subviews of a view controller's view.\n\n```swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    view.layout {\n        label\n            .toSafeArea([.top])\n            .center(.horizontal)\n        imageView\n            .toSideEdges(inset: 20)\n            .height(200)\n        button\n            .center(.horizontal)\n    }\n    .vertical([label, imageView, button], spacing: 50)\n    .activate()\n}\n```\n\nThe code above is equivalent to the following Auto Layout code.\n\n```swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    label.translatesAutoresizingMaskIntoConstraints = false\n    imageView.translatesAutoresizingMaskIntoConstraints = false\n    button.translatesAutoresizingMaskIntoConstraints = false\n    view.addSubview(label)\n    view.addSubview(imageView)\n    view.addSubview(button)\n    NSLayoutConstraint.activate([\n        label.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),\n        label.centerXAnchor.constraint(equalTo: view.centerXAnchor),\n        imageView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 20),\n        imageView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -20),\n        imageView.heightAnchor.constraint(equalToConstant: 200),\n        button.centerXAnchor.constraint(equalTo: view.centerXAnchor),\n        imageView.topAnchor.constraint(equalTo: label.bottomAnchor, constant: 50),\n        button.topAnchor.constraint(equalTo: imageView.bottomAnchor, constant: 50)\n    ])\n}\n```\n\n## Documentation\n\nDocumentation is viewable in Xcode by selecting `Build Documentation` from the `Product` menu, or online at: https://Tinder.github.io/Layout\n\nAnd a quick reference guide is available at: https://Tinder.github.io/Layout/cheatsheet\n\n## Related Tools\n\nLayout is an alternative solution to other open source Auto Layout libraries, such as:\n\n- [SnapKit](https://github.com/SnapKit/SnapKit)\n- [PureLayout](https://github.com/PureLayout/PureLayout)\n- [Cartography](https://github.com/robb/Cartography)\n\n## Contributing\n\nWhile interest in contributing to this project is appreciated, it has been open \nsourced solely for the purpose of sharing with the community. This means we are \nunable to accept outside contributions at this time and pull requests will not \nbe reviewed or merged. To report a security concern or vulnerability, please \nsubmit a GitHub issue.\n\n## License\n\nLicensed under the [Match Group Modified 3-Clause BSD License](\nhttps://github.com/Tinder/Layout/blob/main/LICENSE\n).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinder%2Flayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinder%2Flayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinder%2Flayout/lists"}