{"id":15170605,"url":"https://github.com/maximkrouk/suilayout","last_synced_at":"2025-10-25T19:30:58.323Z","repository":{"id":62454598,"uuid":"194120491","full_name":"maximkrouk/SUILayout","owner":"maximkrouk","description":"SwiftUI sizing DSL, inspired by SnapKit.","archived":false,"fork":false,"pushed_at":"2019-10-29T21:21:51.000Z","size":66,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T14:41:54.256Z","etag":null,"topics":["autolayout","cocoapods","constraints","layout","sizing","swift","swift5-1","swiftui","xcode11"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximkrouk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-27T15:30:35.000Z","updated_at":"2023-11-10T08:10:22.000Z","dependencies_parsed_at":"2022-11-02T00:01:26.770Z","dependency_job_id":null,"html_url":"https://github.com/maximkrouk/SUILayout","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FSUILayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FSUILayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FSUILayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FSUILayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximkrouk","download_url":"https://codeload.github.com/maximkrouk/SUILayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865149,"owners_count":16555931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["autolayout","cocoapods","constraints","layout","sizing","swift","swift5-1","swiftui","xcode11"],"created_at":"2024-09-27T08:04:13.237Z","updated_at":"2025-10-25T19:30:58.004Z","avatar_url":"https://github.com/maximkrouk.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SUILayout 🍃\n\n__Lightweight sizing dsl for SwiftUI__\n\nSometimes it's pretty annoying to type something like `.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)` , so I decided to extract common cases to this tiny framework.\n\n## Usage\n\n```swift\nimport SUILayout\nimport SwiftUI\n\nstruct MyView: View {\n\n    var body: some View {\n        Text(\"Awesome SwiftUI\")\n      \t\t\t.foregroundColor(.white)\n            .pin.toLeft()\n            .pin.size(to: .square(240))\n      \t\t\t.background(Color.black)\n    }\n\n}\n```\n\n__Pins:__\n\n- `toScreen(multipliedBy multipliers: CGPoint)`\n- `toScreen(insetBy inset: CGPoint = .zero)`\n- `sizeToScreen(multipliedBy multipliers: CGPoint)`\n- `sizeToScreen(insetBy insets: CGPoint = .zero)`\n- `widthToScreen(multipliedBy multiplier: CGFloat)`\n- `widthToScreen(insetBy inset: CGFloat = 0)`\n- `heightToScreen(multipliedBy multiplier: CGFloat)`\n- `heightToScreen(insetBy inset: CGFloat = 0)`\n- `toSuperview()`\n- `sizeToSuperview(multipliedBy multipliers: CGPoint)`\n- `size(to size: CGSize)`\n- `sizeToSuperview()`\n- `widthToSuperview()`\n- `widthToSuperview(multipliedBy multiplier: CGFloat)`\n- `widthToSuperview(insetBy inset: CGFloat)`\n- `heightToSuperview()`\n- `heightToSuperview(multipliedBy multiplier: CGFloat)`\n- `heightToSuperview(insetBy inset: CGFloat)`\n- `toTop()`\n- `toBottom()`\n- `toLeft()`\n- `toRight()`\n\n## Requirements\n\n* ⌨️\tXCode 11.0+\n* 🖥\tOSX 10.15+\n* 📱\tiOS 13.0+\n\n## Installation\n\n#### Primary:\n\nVia SwiftPM, just add a link to this repo to your Package.swift file.\n\n```swift\n.package(url: \"https://github.com/maximkrouk/SUILayout.git\", from: \"3.0.0\")\n```\n\nOr use XCodePM.\n\n#### Secondary:\n\nSUILayout is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'SUILayout'\n```\nand run `pod install` from the terminal.\n\n---\n\n*Feel free to contribute or [communicate](https://twitter.com/maximkrouk).*\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkrouk%2Fsuilayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximkrouk%2Fsuilayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkrouk%2Fsuilayout/lists"}