{"id":1274,"url":"https://github.com/floriankrueger/Manuscript","last_synced_at":"2025-07-30T20:33:01.106Z","repository":{"id":30943278,"uuid":"34501322","full_name":"floriankrueger/Manuscript","owner":"floriankrueger","description":"AutoLayoutKit in pure Swift.","archived":false,"fork":false,"pushed_at":"2017-04-19T12:53:29.000Z","size":545,"stargazers_count":76,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-27T22:38:49.627Z","etag":null,"topics":["autolayout","carthage","cocoapods","ios","manuscript","swift","tvos","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/floriankrueger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-24T06:14:20.000Z","updated_at":"2022-08-21T01:05:45.000Z","dependencies_parsed_at":"2022-09-08T12:10:13.863Z","dependency_job_id":null,"html_url":"https://github.com/floriankrueger/Manuscript","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/floriankrueger/Manuscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FManuscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FManuscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FManuscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FManuscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floriankrueger","download_url":"https://codeload.github.com/floriankrueger/Manuscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FManuscript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267645428,"owners_count":24120881,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","carthage","cocoapods","ios","manuscript","swift","tvos","uikit"],"created_at":"2024-01-05T20:15:42.703Z","updated_at":"2025-07-30T20:33:00.667Z","avatar_url":"https://github.com/floriankrueger.png","language":"Swift","funding_links":[],"categories":["Layout"],"sub_categories":["Other Hardware","Other free courses"],"readme":"[![GitHub release](https://img.shields.io/github/release/floriankrueger/Manuscript.svg)](https://github.com/floriankrueger/Manuscript)\n[![CircleCI](https://img.shields.io/circleci/project/floriankrueger/Manuscript.svg)](https://circleci.com/gh/floriankrueger/Manuscript)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods](https://img.shields.io/cocoapods/v/Manuscript.svg)](https://github.com/floriankrueger/Manuscript)\n[![Swift](https://img.shields.io/badge/Swift-3.0-orange.svg)](https://swift.org)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/floriankrueger/Manuscript/master/LICENSE)\n [![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square)](https://gitmoji.carloscuesta.me)\n \n![Manuscript: Dead-Simple AutoLayout](https://raw.githubusercontent.com/floriankrueger/Manuscript/assets/manuscript.png)\n\nIt's like [AutoLayoutKit](https://github.com/floriankrueger/AutoLayoutKit) but written in Swift.\nFor pure Swift projects. And it's super simple.\n\n## Features\n\n- [x] concise, simple and convenient API\n- [x] raw AutoLayout power\n- [x] no black magic involved\n- [x] fully documented\n- [x] completely unit-tested\n\nHave a look at the [Changelog](CHANGELOG.md) for more details.\n\n## Requirements\n\n- iOS 8.0+\n- Xcode 8.x\n- Swift 3.1\n\n### Bonus: Support for iOS 7.0+ and/or tvOS\n\nAlthough the cocoapods isn't able to install Manuscript for your iOS 7.0+ app or for your tvOS app\n(yet), you can use still Manuscript. Just follow the 'manual' installation or add Manuscript as a\nframework project to your workspace (that's what I do).\n\n## What it looks like\n\n```swift\nManuscript.layout(myButton) { c in\n  c.set(.Height, to: 60.0)\n  c.set(.Width, to: 60.0)\n  c.make(.Bottom, equalTo: self.view, s: .Bottom, minus: 10.0)\n  c.make(.CenterX, equalTo: self.view, s: .CenterX)\n}\n```\n\n## Usage\n\nA few examples on how to use Manuscript.\n\n### Center and set size\n\nCenter a UIView 'childView' in self.view and make it 30 by 30 in size\n\n```swift\nManuscript.layout(childView) { c in\n  c.make(.CenterX, equalTo: view, s: .CenterX)\n  c.make(.CenterY, equalTo: view, s: .CenterY)\n  c.set(.Width, to: 30.0)\n  c.set(.Height, to: 30.0)\n}\n```\n\nThe same, but using the convenience methods\n\n```swift\nManuscript.layout(childView) { c in\n  c.centerIn(view)\n  c.setSize(CGSize(width: 30.0, height: 30.0))\n}\n```\n\n### Align all edges of a view to a superview\n\nAlign a UIView 'container' to all edges of self.view\n\n```swift\nManuscript.layout(container) { c in\n  c.make(.Left, equalTo: view, s: .Left)\n  c.make(.Right, equalTo: view, s: .Right)\n  c.make(.Top, equalTo: view, s: .Top)\n  c.make(.Bottom, equalTo: view, s: .Bottom)\n}\n```\n\nThe same, but using the convenience methods\n\n```swift\nManuscript.layout(container) { c in\n  c.alignAllEdges(to: view)\n}\n```\n\n### Align all sides with insets\n\nAlign a UIView 'container' to all edges of self.view and leave a 30 point margin around the\ncontainer.\n\n```swift\nManuscript.layout(container) { c in\n  c.make(.Left, equalTo: view, s: .Left, plus: 30.0)\n  c.make(.Right, equalTo: view, s: .Right, minus: 30.0)\n  c.make(.Top, equalTo: view, s: .Top, plus: 30.0)\n  c.make(.Bottom, equalTo: view, s: .Bottom, minus: 30.0)\n}\n```\n\nThe same, but using convenience methods.\n\n```swift\nManuscript.layout(container) { c in\n  c.alignAllEdges(to: view, withInsets: UIEdgeInsets(top: 30.0, left: 30.0, bottom: 30.0, right: 30.0))\n}\n```\n\n### Use LayoutGuides\n\nMake use of the LayoutGuides provided by UIViewController.\n\n```swift\nManuscript.layout(container) { c in\n  c.make(.Left, equalTo: view, s: .Left)\n  c.make(.Right, equalTo: view, s: .Right)\n  c.make(.Top, equalTo: topLayoutGuide, s: .Baseline)\n  c.make(.Bottom, equalTo: bottomLayoutGuide, s: .Baseline)\n}\n```\n\n### Hairlines\n\nThere is a utility method to create hairlines which takes the screen scale into account.\n\n```swift\nManuscript.layout(mySeparatorLine) { c in\n  c.make(.Left, equalTo: view, s: .Left)\n  c.make(.Right, equalTo: view, s: .Right)\n  c.make(.Top, equalTo: topLayoutGuide, s: .Baseline)\n\n  // sets the .Height to 1.0 on non-retina displays and to 0.5 on retina displays\n  c.makeHorizontalHairline()\n}\n```\n\n### Work with the created Layout Constraints\n\nThe functions `make` and `set` return a tuple of type `LayoutItem` which translates to\n`(constraint: NSLayoutConstraint?, targetItem: UIView?)`. The 'constraint' is the created\n`NSLayoutConstraint`, the 'targetItem' is the view to which the `NSLayoutConstraint` was added. It\nis the nearest common superview of the `UIView`s involved.\n\n```swift\nManuscript.layout(container) { c in\n  leftConstaint = c.make(.Left, equalTo: view, s: .Left).constraint\n  rightConstaint = c.make(.Right, equalTo: view, s: .Right).constraint\n  topConstaint = c.make(.Top, equalTo: topLayoutGuide, s: .Baseline).constraint\n  bottomConstaint = c.make(.Bottom, equalTo: bottomLayoutGuide, s: .Baseline).constraint\n}\n```\n\nAfterwards, just modify the constraint's constant and apply the changes (this is plain AutoLayout).\n\n```swift\nUIView.animateWithDuration(0.6) { in\n  topConstraint?.constant = 100\n  view.layoutIfNeeded()\n}\n```\n\n### Convenience Methods\n\nThe convenience methods return arrays of the mentioned tuples. These will be dictionaries or tuples\nin the future as well to provide easier access to the created constraints. Until then, check the\ncode for the order of the returned constraints.\n\n## Installation\n\nAs for now, you can use [Carthage](https://github.com/Carthage/Carthage) or [CocoaPods](https://cocoapods.org) to install Manuscript\nusing a dependency manager or do it manually.\n\n### Carthage\n\nTo integrate Manuscript into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"floriankrueger/Manuscript\"\n```\n\nIf you need to support Swift 2.3 then please use the last compatible version 2.1.0\n\n```ogdl\ngithub \"floriankrueger/Manuscript\" == 2.1.0\n```\n \nIf you need to support Swift 3.0 then please use the last compatible version 3.0.1\n \n```ogdl\ngithub \"floriankrueger/Manuscript\" == 3.0.1\n```\n\nIf your Swift 3.1 compiler isn't compatible with the framework binary from the github release then \nplease use the following command to build Manuscript yourself:\n \n```\ncarthage bootstrap Manuscript --no-use-binaries\n```\n \n### CocoaPods\n\nMake sure your `Podfile` contains all of the following lines.\n\n```ruby\nuse_frameworks!\nplatform :ios, '8.0'\n\npod 'Manuscript'\n```\n\nThen run `pod install`.\n\n### Manually\n\nTo do it 'by hand' take the following files and add them to your project:\n\n- `Source/Manuscript.swift`\n- `Source/LayoutProxy.swift`\n\n## License\n\nManuscript is released under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankrueger%2FManuscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriankrueger%2FManuscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankrueger%2FManuscript/lists"}