{"id":17066740,"url":"https://github.com/kgn/kgnautolayout","last_synced_at":"2025-04-12T18:14:05.152Z","repository":{"id":56917172,"uuid":"44425204","full_name":"kgn/KGNAutoLayout","owner":"kgn","description":"Making AutoLayout Easy","archived":false,"fork":false,"pushed_at":"2020-07-29T04:25:56.000Z","size":7478,"stargazers_count":124,"open_issues_count":1,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-12T18:13:54.758Z","etag":null,"topics":["appletv","autolayout","ios","swift","ui","uikit"],"latest_commit_sha":null,"homepage":null,"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/kgn.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":"2015-10-17T05:24:33.000Z","updated_at":"2025-03-13T18:08:09.000Z","dependencies_parsed_at":"2022-08-20T21:20:28.888Z","dependency_job_id":null,"html_url":"https://github.com/kgn/KGNAutoLayout","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgn%2FKGNAutoLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgn%2FKGNAutoLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgn%2FKGNAutoLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgn%2FKGNAutoLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgn","download_url":"https://codeload.github.com/kgn/KGNAutoLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610336,"owners_count":21132920,"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":["appletv","autolayout","ios","swift","ui","uikit"],"created_at":"2024-10-14T11:08:08.617Z","updated_at":"2025-04-12T18:14:05.128Z","avatar_url":"https://github.com/kgn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KGNAutoLayout\n\n`KGNAutoLayout` makes `AutoLayout` easy!\n\n[![Swift 3](http://img.shields.io/badge/Swift-3-orange.svg)]()\n[![Release](https://img.shields.io/github/release/kgn/KGNAutoLayout.svg)](/releases)\n[![License](http://img.shields.io/badge/License-MIT-lightgrey.svg)](/LICENSE)\n\n[![Build Status](https://travis-ci.org/kgn/KGNAutoLayout.svg)](https://travis-ci.org/kgn/KGNAutoLayout)\n[![Test Coverage](http://img.shields.io/badge/Tests-98%25-green.svg)]()\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-Compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n[![CocoaPods Version](https://img.shields.io/cocoapods/v/KGNAutoLayout.svg)](https://cocoapods.org/pods/KGNAutoLayout)\n[![CocoaPods Platforms](https://img.shields.io/cocoapods/p/KGNAutoLayout.svg)](https://cocoapods.org/pods/KGNAutoLayout)\n\n[![Twitter](https://img.shields.io/badge/Twitter-@iamkgn-55ACEE.svg)](http://twitter.com/iamkgn)\n[![Follow](https://img.shields.io/github/followers/kgn.svg?style=social\u0026label=Follow%20%40kgn)](https://github.com/kgn)\n[![Star](https://img.shields.io/github/stars/kgn/KGNAutoLayout.svg?style=social\u0026label=Star)](https://github.com/kgn/KGNAutoLayout)\n\n## Installing\n\n### Carthage\n```\ngithub \"kgn/KGNAutoLayout\"\n```\n\n### CocoaPods\n```\npod 'KGNAutoLayout'\n```\n\n## Examples\n\n### Example App\n\n![Example App](/KGNAutoLayoutExample.gif)\n\n### Pin: Superview\n\n``` Swift\nview.pinToEdgesOfSuperview(withOffset: 20)\n```\n![pinToEdgesOfSuperview_offset20](Example/Snapshots/pinToEdgesOfSuperview_offset20.png)\n--\n\n\n``` Swift\nview.pinToTopEdgeOfSuperview(withOffset: 20)\n```\n![pinToTopEdgeOfSuperview_offset20](Example/Snapshots/pinToTopEdgeOfSuperview_offset20.png)\n--\n\n\n``` Swift\nview.pinToRightEdgeOfSuperview(withOffset: 20)\n```\n![pinToRightEdgeOfSuperview_offset20](Example/Snapshots/pinToRightEdgeOfSuperview_offset20.png)\n--\n\n\n``` Swift\nview.pinToBottomEdgeOfSuperview(withOffset: 20)\n```\n![pinToBottomEdgeOfSuperview_offset20](Example/Snapshots/pinToBottomEdgeOfSuperview_offset20.png)\n--\n\n\n``` Swift\nview.pinToLeftEdgeOfSuperview(withOffset: 20)\n```\n![pinToLeftEdgeOfSuperview_offset20](Example/Snapshots/pinToLeftEdgeOfSuperview_offset20.png)\n--\n\n\n``` Swift\nview.pinToSideEdgesOfSuperview(withOffset: 20)\n```\n![pinToSideEdgesOfSuperview_offset20](Example/Snapshots/pinToSideEdgesOfSuperview_offset20.png)\n--\n\n\n``` Swift\nview.pinToTopAndBottomEdgesOfSuperview(withOffset: 20)\n```\n![pinToTopAndBottomEdgesOfSuperview_offset20](Example/Snapshots/pinToTopAndBottomEdgesOfSuperview_offset20.png)\n--\n\n### Pin: Edges\n\n``` Swift\nview.pinTopEdgeToTopEdge(of: itemView, withOffset: 20)\n```\n![pinTopEdgeToTopEdgeOfItem_offset20](Example/Snapshots/pinTopEdgeToTopEdgeOfItem_offset20.png)\n--\n\n\n``` Swift\nview.pinRightEdgeToRightEdge(of: itemView, withOffset: 20)\n```\n![pinRightEdgeToRightEdgeOfItem_offset20](Example/Snapshots/pinRightEdgeToRightEdgeOfItem_offset20.png)\n--\n\n\n``` Swift\nview.pinBottomEdgeToBottomEdge(of: itemView, withOffset: 20)\n```\n![pinBottomEdgeToBottomEdgeOfItem_offset20](Example/Snapshots/pinBottomEdgeToBottomEdgeOfItem_offset20.png)\n--\n\n\n``` Swift\nview.pinLeftEdgeToLeftEdge(of: itemView, withOffset: 20)\n```\n![pinLeftEdgeToLeftEdgeOfItem_offset20](Example/Snapshots/pinLeftEdgeToLeftEdgeOfItem_offset20.png)\n--\n\n### Center\n\n``` Swift\nview.centerInSuperview()\n```\n![centerInSuperview](Example/Snapshots/centerInSuperview.png)\n--\n\n\n``` Swift\nview.centerHorizontallyInSuperview()\n```\n![centerHorizontallyInSuperview](Example/Snapshots/centerHorizontallyInSuperview.png)\n--\n\n\n``` Swift\nview.centerVerticallyInSuperview()\n```\n![centerVerticallyInSuperview](Example/Snapshots/centerVerticallyInSuperview.png)\n--\n\n\n``` Swift\n[view1, view2, view3].centerHorizontally(to: parentView, withSeparation: 20)\n```\n![centerViewsHorizontally_separation20](Example/Snapshots/centerViewsHorizontally_separation20.png)\n--\n\n\n``` Swift\n[view1, view2, view3].centerVertically(to: parentView, withSeparation: 20)\n```\n![centerViewsVertically_separation20](Example/Snapshots/centerViewsVertically_separation20.png)\n--\n\n\n``` Swift\nview.centerHorizontally(to: itemView)\n```\n![centerHorizontallyToItem](Example/Snapshots/centerHorizontallyToItem.png)\n--\n\n\n``` Swift\nview.centerVertically(to: itemView)\n```\n![centerVerticallyToItem](Example/Snapshots/centerVerticallyToItem.png)\n--\n\n### Size\n\n``` Swift\nview.size(toWidth: 80)\n```\n![sizeToWidth80](Example/Snapshots/sizeToWidth80.png)\n--\n\n\n``` Swift\nview.size(toMinWidth: 40)\n```\n![sizeToMinWidth40](Example/Snapshots/sizeToMinWidth40.png)\n--\n\n\n``` Swift\nview.size(toMaxWidth: 100)\n```\n![sizeToMaxWidth100](Example/Snapshots/sizeToMaxWidth100.png)\n--\n\n\n``` Swift\nview.size(toHeight: 80)\n```\n![sizeToHeight80](Example/Snapshots/sizeToHeight80.png)\n--\n\n\n``` Swift\nview.size(toMinHeight: 40)\n```\n![sizeToMinHeight40](Example/Snapshots/sizeToMinHeight40.png)\n--\n\n\n``` Swift\nview.size(toMaxHeight: 100)\n```\n![sizeToMaxHeight100](Example/Snapshots/sizeToMaxHeight100.png)\n--\n\n\n``` Swift\nview.size(toWidthAndHeight: 80)\n```\n![sizeToWidthAndHeight80](Example/Snapshots/sizeToWidthAndHeight80.png)\n--\n\n\n``` Swift\nview.size(toMinWidthAndHeight: 40)\n```\n![sizeToMinWidthAndHeight40](Example/Snapshots/sizeToMinWidthAndHeight40.png)\n--\n\n\n``` Swift\nview.size(toMaxWidthAndHeight: 100)\n```\n![sizeToMaxWidthAndHeight100](Example/Snapshots/sizeToMaxWidthAndHeight100.png)\n--\n\n\n``` Swift\nview.sizeWidthToWidth(of: itemView)\n```\n![sizeWidthToWidthOfItem](Example/Snapshots/sizeWidthToWidthOfItem.png)\n--\n\n\n``` Swift\nview.sizeHeightToHeight(of: itemView)\n```\n![sizeHeightToHeightOfItem](Example/Snapshots/sizeHeightToHeightOfItem.png)\n--\n\n\n``` Swift\nview.sizeHeightToWidth(of: itemView)\n```\n![sizeHeightToWidthOfItem](Example/Snapshots/sizeHeightToWidthOfItem.png)\n--\n\n\n``` Swift\nview.sizeWidthToHeight(of: itemView)\n```\n![sizeWidthToHeightOfItem](Example/Snapshots/sizeWidthToHeightOfItem.png)\n--\n\n\n``` Swift\nview.sizeWidthAndHeightToWidthAndHeight(of: itemView)\n```\n![sizeWidthAndHeightToWidthAndHeightOfItem](Example/Snapshots/sizeWidthAndHeightToWidthAndHeightOfItem.png)\n--\n\n\n``` Swift\nview.sizeHeightToWidth(withAspectRatio: 16/9)\n```\n![sizeHeightToWidthAspectRatio16by9](Example/Snapshots/sizeHeightToWidthAspectRatio16by9.png)\n--\n\n\n``` Swift\nview.sizeWidthToHeight(withAspectRatio: 16/9)\n```\n![sizeWidthToHeightAspectRatio16by9](Example/Snapshots/sizeWidthToHeightAspectRatio16by9.png)\n--\n\n### Position\n\n``` Swift\nview.positionAbove(itemView, withOffset: 20)\n```\n![positionAboveItem_offset20](Example/Snapshots/positionAboveItem_offset20.png)\n--\n\n\n``` Swift\nview.positionToTheRight(of: itemView, withOffset: 20)\n```\n![positionToTheRightOfItem_offset20](Example/Snapshots/positionToTheRightOfItem_offset20.png)\n--\n\n\n``` Swift\nview.positionBelow(itemView, withOffset: 20)\n```\n![positionBelowItem_offset20](Example/Snapshots/positionBelowItem_offset20.png)\n--\n\n\n``` Swift\nview.positionToTheLeft(of: itemView, withOffset: 20)\n```\n![positionToTheLeftOfItem_offset20](Example/Snapshots/positionToTheLeftOfItem_offset20.png)\n--\n\n\n``` Swift\n[view1, view2, view3].positionAbove(itemView, withOffset: 20)\n```\n![positionViewsAbove_offset20](Example/Snapshots/positionViewsAbove_offset20.png)\n--\n\n\n``` Swift\n[view1, view2, view3].positionToTheRight(of: itemView, withOffset: 20)\n```\n![positionViewsToTheRight_offset20](Example/Snapshots/positionViewsToTheRight_offset20.png)\n--\n\n\n``` Swift\n[view1, view2, view3].positionBelow(itemView, withOffset: 20)\n```\n![positionViewsBelow_offset20](Example/Snapshots/positionViewsBelow_offset20.png)\n--\n\n\n``` Swift\n[view1, view2, view3].positionToTheLeft(of: itemView, withOffset: 20)\n```\n![positionViewsToTheLeft_offset20](Example/Snapshots/positionViewsToTheLeft_offset20.png)\n--\n\n### Between\n\n``` Swift\nview.fitBetween(top: topView, andBottom: bottomView, withOffset: 20)\n```\n![fitBetweenTopAndBottomItems_offset20](Example/Snapshots/fitBetweenTopAndBottomItems_offset20.png)\n--\n\n\n``` Swift\nview.fitBetween(left: leftView, andRight: rightView, withOffset: 20)\n```\n![fitBetweenLeftAndRightItems_offset20](Example/Snapshots/fitBetweenLeftAndRightItems_offset20.png)\n--\n\n### Fill\n\n``` Swift\nparentView.fillHorizontally(withViews: [view1, view2, view3], separation: 20)\n```\n![fillHorizontally_separation20](Example/Snapshots/fillHorizontally_separation20.png)\n--\n\n\n``` Swift\nparentView.fillVertically(withViews: [view1, view2, view3], separation: 20)\n```\n![fillVertically_separation20](Example/Snapshots/fillVertically_separation20.png)\n--\n\n### Bound\n\n``` Swift\nitemView.boundHorizontally(withViews: [view1, view2, view3], separation: 20)\n```\n![boundHorizontally_separation20](Example/Snapshots/boundHorizontally_separation20.png)\n--\n\n\n``` Swift\nitemView.boundVertically(withViews: [view1, view2, view3], separation: 20)\n```\n![boundVertically_separation20](Example/Snapshots/boundVertically_separation20.png)\n--\n\n\n``` Swift\nitemView.boundVertically(withViews: [view1, view2, view3], separation: 20)\n```\n![boundVertically_separation20](Example/Snapshots/boundVertically_separation20.png)\n\n## Progress:\n- [X] Travis\n- [X] Badges\n- [X] Tests\n- [X] Carthage\n- [X] CocoaPods\n- [X] Description\n- [X] Documentation\n- [X] Example App\n- [X] AppleTV\n- [X] Prebuilt Frameworks\n- [ ] Travis Test Matrix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgn%2Fkgnautolayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgn%2Fkgnautolayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgn%2Fkgnautolayout/lists"}