{"id":16948632,"url":"https://github.com/TimOliver/CoreLayout","last_synced_at":"2026-01-24T05:30:18.223Z","repository":{"id":57679356,"uuid":"492132584","full_name":"TimOliver/CoreLayout","owner":"TimOliver","description":"A collection of convenience properties and extensions for laying out views in UIKit","archived":false,"fork":false,"pushed_at":"2025-01-16T10:12:28.000Z","size":499,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-13T02:53:52.513Z","etag":null,"topics":["coregraphics","ios","layout","uikit"],"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/TimOliver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"timoliver"}},"created_at":"2022-05-14T06:31:57.000Z","updated_at":"2025-02-11T03:12:15.000Z","dependencies_parsed_at":"2025-01-16T10:33:16.041Z","dependency_job_id":"a0386ef3-43ca-4e41-9bb5-cca231c3e13b","html_url":"https://github.com/TimOliver/CoreLayout","commit_stats":null,"previous_names":["timoliver/cglayoutkit","timoliver/corelayout"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCoreLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCoreLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCoreLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FCoreLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimOliver","download_url":"https://codeload.github.com/TimOliver/CoreLayout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239766759,"owners_count":19693377,"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":["coregraphics","ios","layout","uikit"],"created_at":"2024-10-13T21:51:43.010Z","updated_at":"2026-01-24T05:30:17.782Z","avatar_url":"https://github.com/TimOliver.png","language":"Swift","funding_links":["https://ko-fi.com/timoliver"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"Logo.webp\" alt=\"CoreLayout\" /\u003e\n\n\u003cspan align=\"center\"\u003e\n\n[![CI](https://github.com/TimOliver/CoreLayout/workflows/CI/badge.svg)](https://github.com/TimOliver/CoreLayout/actions?query=workflow%3ACI)\n![Version](https://img.shields.io/cocoapods/v/CoreLayout.svg?style=flat)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/TimOliver/CoreLayout/main/LICENSE)\n![Platform](https://img.shields.io/cocoapods/p/CoreLayout.svg?style=flat)\n    \n\u003c/span\u003e\n\nCore Layout is a framework with the mission of filling the gaps in Core Graphics layout logic when working with configuring and laying out `UIView` components. The framework features a collections of extensions for popular UIKit and Core Graphics components in order to make working with them much more streamlined and efficient.\n\nWhile Auto Layout is officially recommended as the best way to lay out UI components in UIKit, it does have some downsides. When the rules and complexity of the layout become too high, performance can often take a hit. Likewise, when constraints break, debugging what went wrong can sometimes take a long time.\n\nFor this reason, sometimes manual frame layout is still the preferred method. However most of the time, it involves a lot of repetitive, hard-to-read math expressions. The goal of Core Layout is to help automate away a lot of the repetitive aspects of these expressions, making manual layout easier to type, and easier to read, without introducing the same performance overhead of Auto Layout.\n\n# Features\n\n* Adds semantically named accessors (eg. `topLeft`) to `CGRect` and `UIView`.\n* Adds convenient offsetting APIs to `CGPoint`.\n* Adds additional sizing mechanisms to `CGSize`.\n* Streamlines configuring rounded `UIView` layers and laying out elements in it appropriately.\n\n# Instructions\n\nAs a very simple use-case, consider how you would lay out this red view inside of its white container view. \n\n\u003cimg src=\"Example.png\" alt=\"CoreLayout Example\" width = \"500\" /\u003e\n    \nIt would probably look something like this.\n\n```swift\nredView.frame.origin.x = containerView.frame.width - (redView.frame.width + 10)\nredView.frame.origin.y = (containerView.frame.height - redView.frame.height) * 0.5\n```\n\nThis is super performant and is simple enough to write, but it isn't very easy to read after the fact.\n\nWith Core Layout, the equivalent code becomes this.\n\n```swift\nredView.rightCenter = containerView.bounds.rightCenter.offsetBy(dx: -10)\n```\n\nBy defining and using relative anchors, we can achieve a similar flexibility to Auto Layout, but in a much simpler way.\n\n# Requirements\n* Swift 5\n* UIKit-compatible platforms (iOS, tvOS, Mac Catalyst)\n\n# Installation\n\nCore Layout is a very simple framework and can be easily imported manually or with CocoaPods.\n\n## Manual Installation\n\nDrag the `CoreLayout` folder into your Xcode project.\n\n### CocoaPods\n\n```\npod 'CoreLayout'\n```\n\n### SPM\n\nI'll add this eventually. But if you want it now, please file a PR!\n\n# Credits\n\nCore Layout was built as a component of iComics 2 by [Tim Oliver](https://threads.net/@timoliver)\n\n# License\n\nCore Layout is available under the MIT License. Please check the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTimOliver%2FCoreLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTimOliver%2FCoreLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTimOliver%2FCoreLayout/lists"}