{"id":20885224,"url":"https://github.com/icungse/autolayouts","last_synced_at":"2025-03-12T17:44:47.818Z","repository":{"id":177688706,"uuid":"660456533","full_name":"icungse/AutoLayouts","owner":"icungse","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-09T05:36:55.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T22:45:38.216Z","etag":null,"topics":["constraint-layout","ios","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/icungse.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-30T03:50:52.000Z","updated_at":"2023-07-01T23:25:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"efc17c25-8d99-4807-8f38-6f05768fc9cd","html_url":"https://github.com/icungse/AutoLayouts","commit_stats":null,"previous_names":["icungse/autolayouts"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icungse%2FAutoLayouts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icungse%2FAutoLayouts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icungse%2FAutoLayouts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icungse%2FAutoLayouts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icungse","download_url":"https://codeload.github.com/icungse/AutoLayouts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243267275,"owners_count":20263799,"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":["constraint-layout","ios","uikit"],"created_at":"2024-11-18T08:12:51.477Z","updated_at":"2025-03-12T17:44:47.804Z","avatar_url":"https://github.com/icungse.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoLayouts\n\u003cimg src=\"https://img.shields.io/badge/platforms-iOS%20-333333.svg\" alt=\"Supported Platforms: iOS, macOS, tvOS, watchOS \u0026 Linux\" /\u003e\n\u003ca href=\"https://cocoapods.org/pods/AutoLayouts\" alt=\"AutoLayouts on CocoaPods\" title=\"AutoLayouts on CocoaPods\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/v/AutoLayouts.svg\" /\u003e\u003c/a\u003e\n\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n\n\n\u003c/p\u003e\n\nA simple helper for constraints management in UIKit. \n\n## Installation \n\nAutoLayouts is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\n    pod 'AutoLayouts'\n```\n\n## Usage\n\n- Init View\n\n    Simply init the view and add sub view to parent with `with(parent: \u003cUIVIew\u003e)`\n\n    ```swift\n    lazy var subView = UIView().withParent(parentView)\n    ```\n\n- Add constraint\n\n  Just add use `makeConstraint(using: \u003c#T##(LayoutDelegate) -\u003e Void#\u003e)` and fill the closure with LayoutDelegate\n\n    ```swift\n    subView.makeConstraint { constraint in\n        constraint.leadingAnchor == parentView.leadingAnchor + 8\n        constraint.topAnchor == parentView.topAnchor + 8\n        constraint.trailingAnchor == parentView.trailingAnchor - 8\n        constraint.bottomAnchor == parentView.bottomAnchor - 8\n    }\n    ```\n\n- Set Height\n    \n    Use `setWidth(by width: CGFloat)` in extension of UIView to set view height\n    ```swift\n    yourView.setWidth(by width: CGFloat)\n    ```\n- Set Width\n\n    Use `setHeight(by height: CGFloat)` in extension of UIView to set view height\n    ```swift\n    youtView.setHeight(by height: CGFloat)\n    ```\n- Set Witdh and Height\n    Use `setWidth(_ width: CGFloat, andHeight: CGFloat)` in extension of UIView to set view height\n    ```swift\n    yourView.setWidth(_ width: CGFloat, andHeight: CGFloat)\n    ```\n\n## LayoutDelegate\nAvailability of Layout delegate property:\n- topAnchor\n- bottomAnchor\n- leftAnchor\n- rightAnchor\n- leadingAnchor\n- trailingAnchor\n- centerYAnchor\n- centerXAnchor\n- widthAnchor\n- heightAnchor\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficungse%2Fautolayouts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficungse%2Fautolayouts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficungse%2Fautolayouts/lists"}