{"id":16924182,"url":"https://github.com/dogo/sketchkit","last_synced_at":"2025-05-05T22:15:40.113Z","repository":{"id":49671813,"uuid":"212876564","full_name":"dogo/SketchKit","owner":"dogo","description":"A lightweight auto-layout DSL library for iOS, tvOS \u0026 macOS.","archived":false,"fork":false,"pushed_at":"2024-09-22T22:35:42.000Z","size":1163,"stargazers_count":47,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-05-05T22:15:32.144Z","etag":null,"topics":["auto-layout","autolayout","carthage","cocoapods","dsl","ios","ios-swift","keyboardlayoutguide","macos","nslayoutconstraint","nslayoutconstraints","nslayoutguide","spm","swift","swift-package-manager","uilayoutguide"],"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/dogo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-10-04T18:14:07.000Z","updated_at":"2025-03-27T01:44:53.000Z","dependencies_parsed_at":"2023-12-16T11:45:49.374Z","dependency_job_id":"dd9d7006-584e-46cd-a7b7-84dcbe96e2cb","html_url":"https://github.com/dogo/SketchKit","commit_stats":{"total_commits":136,"total_committers":2,"mean_commits":68.0,"dds":0.02941176470588236,"last_synced_commit":"b320b66ee324c6911b3dbaba90a13184cb0bb5b9"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogo%2FSketchKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogo%2FSketchKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogo%2FSketchKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogo%2FSketchKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dogo","download_url":"https://codeload.github.com/dogo/SketchKit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252584333,"owners_count":21771945,"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":["auto-layout","autolayout","carthage","cocoapods","dsl","ios","ios-swift","keyboardlayoutguide","macos","nslayoutconstraint","nslayoutconstraints","nslayoutguide","spm","swift","swift-package-manager","uilayoutguide"],"created_at":"2024-10-13T20:03:35.151Z","updated_at":"2025-05-05T22:15:40.069Z","avatar_url":"https://github.com/dogo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"/images/SketchKit-Full.png\" alt=\"\" /\u003e\n\n![Build Status](https://github.com/dogo/SketchKit/workflows/Testing/badge.svg)\n[![codecov](https://codecov.io/gh/dogo/SketchKit/branch/develop/graph/badge.svg)](https://codecov.io/gh/dogo/SketchKit)\n[![Cocoapods compatible](https://img.shields.io/cocoapods/v/SketchKit.svg)](https://cocoapods.org/?q=SketchKit)\n[![SPM compatible](https://img.shields.io/badge/SPM-compatible-brightgreen)](https://swift.org/package-manager)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/github/license/dogo/SketchKit.svg)](https://github.com/dogo/SketchKit/blob/develop/LICENSE)\n\nSketchKit is a lightweight, powerful and pure-Swift auto layout library, you can set up your constraints with a simple and intuitive code without any stringly typing.\n\nIn short, it allows you to replace this:\n\n```Swift\nnewView.translatesAutoresizingMaskIntoConstraints = false\n\naddConstraint(NSLayoutConstraint(\n              item: newView,\n              attribute: NSLayoutConstraint.Attribute.centerX,\n              relatedBy: NSLayoutConstraint.Relation.equal,\n              toItem: view,\n              attribute: NSLayoutConstraint.Attribute.centerX,\n              multiplier: 1,\n              constant: 0))\n```\n\nor\n\n```Swift\nnewView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true\n```\n\nwith this\n\n```Swift\n// It's NOT necessary: newView.translatesAutoresizingMaskIntoConstraints = false\nnewView.layout.applyConstraint { view in\n    view.centerXAnchor(equalTo: self.view.centerXAnchor)\n    view.centerYAnchor(equalTo: self.view.centerYAnchor)\n}\n```\n\n## Requirements\n\n- iOS 9.0+ / tvOS 9.0+ / macOS 10.11+\n- Swift 3.2+\n\n## Installation\n\n### [CocoaPods](https://cocoapods.org)\n\nTo integrate SketchKit into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\ntarget '\u003cYour Target Name\u003e' do\n  pod 'SketchKit'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### [Swift Package Manager (SPM)](https://swift.org/package-manager)\n\nTo add `SketchKit` as a dependency, you have to add it to the `dependencies` of your `Package.swift` file and refer to that dependency in your `target`.\n\n```swift\nimport PackageDescription\nlet package = Package(\n    name: \"\u003cYour Product Name\u003e\",\n    dependencies: [\n       .package(url: \"https://github.com/dogo/SketchKit\", .upToNextMajor(from: \"1.0.0\"))\n    ],\n    targets: [\n        .target(\n            name: \"\u003cYour Target Name\u003e\",\n            dependencies: [\"SketchKit\"]),\n    ]\n)\n```\n\nAfter adding the dependency, you can fetch the library with:\n\n```bash\n$ swift package resolve\n```\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\n```\ngithub \"dogo/SketchKit\"\n```\n\n## Usage\n\n### Quick Start\n\n```swift\nimport SketchKit\n\nfinal class MyViewController: UIViewController {\n\n    let myView: UIView = {\n        let view = UIView(frame: .zero)\n        view.color = .red\n        return view\n    }()\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        self.view.addSubview(myView)\n\n        myView.layout.applyConstraint { view in\n            view.topAnchor(equalTo: self.view.topAnchor)\n            view.leadingAnchor(equalTo: self.view.leadingAnchor)\n            view.bottomAnchor(equalTo: self.view.bottomAnchor)\n            view.trailingAnchor(equalTo: self.view.trailingAnchor)\n        }\n    }\n}\n```\n\n## Documentation\nThe project documentation can be found ([here](https://dogo.github.io/SketchKit/index.html)) \n\n## Credits\n\n- Nicholas Babo ([@NickBabo](https://github.com/NickBabo)) thank you for the SketchKit logo,\n\n## License\n\nSketchKit is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogo%2Fsketchkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogo%2Fsketchkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogo%2Fsketchkit/lists"}