{"id":16482785,"url":"https://github.com/shaps80/swiftlayout","last_synced_at":"2026-05-11T21:32:36.148Z","repository":{"id":62456556,"uuid":"50215631","full_name":"shaps80/SwiftLayout","owner":"shaps80","description":"A Swift library for programmatically dealing with AutoLayout","archived":false,"fork":false,"pushed_at":"2017-08-05T10:15:09.000Z","size":161,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T09:23:21.038Z","etag":null,"topics":["autolayout","ios","layout","macos","osx","swift"],"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/shaps80.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":"2016-01-23T00:15:00.000Z","updated_at":"2022-11-27T13:28:11.000Z","dependencies_parsed_at":"2022-11-02T00:16:53.466Z","dependency_job_id":null,"html_url":"https://github.com/shaps80/SwiftLayout","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaps80%2FSwiftLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaps80%2FSwiftLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaps80%2FSwiftLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaps80%2FSwiftLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaps80","download_url":"https://codeload.github.com/shaps80/SwiftLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241214568,"owners_count":19928335,"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","ios","layout","macos","osx","swift"],"created_at":"2024-10-11T13:12:01.761Z","updated_at":"2026-05-11T21:32:36.118Z","avatar_url":"https://github.com/shaps80.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"assets/logo.png\" width=\"100\"\u003e\n\n# SwiftLayout\n\n[![Version](https://img.shields.io/cocoapods/v/SwiftLayout.svg?style=flat)](http://cocoapods.org/pods/SwiftLayout)\n[![License](https://img.shields.io/cocoapods/l/SwiftLayout.svg?style=flat)](http://cocoapods.org/pods/SwiftLayout)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftLayout.svg?style=flat)](http://cocoapods.org/pods/SwiftLayout)\n\n#### Note\nBy default Swift Layout is now using Swift 3.0. You can install either 3.0 or 2.2 version as follows:\n\nSwift 3.0  \n`pod 'SwiftLayout'`  \n\nSwift 2.3 - **Not Supported**\n\nSwift 2.2  \n`pod 'SwiftLayout', '1.3.1'`\n\n---\n\nOften we have to use AutoLayout in our apps. In fact sometimes, we can't even use Interface Builder. Which means we need to add these programmatically.\n\nI had previously done this manually, even occassionally used a 3rd party lib/pod. There are some great libs out there, but I wanted to build my own. Both for my own understanding and also to provide a cleaner interface that made programmatic AutoLayout easy.\n\n__Introducing SwiftLayout__\n\n```swift\nimport SwiftLayout\n\nclass ViewController: UIViewController {\n\n    override func viewDidLoad() {\n      super.viewDidLoad()\n\n      let views = [ addView(), addView(), addView() ]\n\t  views.distribute(along: .vertical, in: view)\n\t  views.size(width: 100, height: 50)\n\t  views.align(axis: .horizontal, in: view)\n\n      let label = UILabel()\n      view.addSubview(label)\n      label.pin(edge: .Left, to: .Right, of: view, margin: 15)\n    }\n\n}\n```\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Installation\n\nSwiftLayout is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"SwiftLayout\"\n```\n\n## Author\n\nShaps Mohsenin, shapsuk@me.com\n\n## License\n\nSwiftLayout is available under the MIT license. See the LICENSE file for more info.\n\n\n## Attributes\n\nIcon: Cluster by Thomas Helbig from the Noun Project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaps80%2Fswiftlayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaps80%2Fswiftlayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaps80%2Fswiftlayout/lists"}