{"id":15038965,"url":"https://github.com/pchelnikov/markerkit","last_synced_at":"2025-09-23T09:58:48.661Z","repository":{"id":62447572,"uuid":"115613092","full_name":"pchelnikov/MarkerKit","owner":"pchelnikov","description":"A lightweight and easy to use wrapper for Auto Layout Constraints","archived":false,"fork":false,"pushed_at":"2019-05-19T10:11:10.000Z","size":331,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-13T01:48:02.030Z","etag":null,"topics":["autolayout","carthage","cocoapods","constraints","layout","markerkit","swift","swift-4","ui","xcode"],"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/pchelnikov.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":"2017-12-28T10:36:55.000Z","updated_at":"2024-07-24T06:29:35.000Z","dependencies_parsed_at":"2022-11-01T23:04:57.474Z","dependency_job_id":null,"html_url":"https://github.com/pchelnikov/MarkerKit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/pchelnikov/MarkerKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchelnikov%2FMarkerKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchelnikov%2FMarkerKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchelnikov%2FMarkerKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchelnikov%2FMarkerKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pchelnikov","download_url":"https://codeload.github.com/pchelnikov/MarkerKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchelnikov%2FMarkerKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276554029,"owners_count":25662960,"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-09-23T02:00:09.130Z","response_time":73,"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","constraints","layout","markerkit","swift","swift-4","ui","xcode"],"created_at":"2024-09-24T20:41:00.894Z","updated_at":"2025-09-23T09:58:48.634Z","avatar_url":"https://github.com/pchelnikov.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MarkerKit](https://github.com/pchelnikov/MarkerKit/blob/master/Assets/marker-kit.jpg)\n\n# MarkerKit\nA lightweight and easy to use wrapper for Auto Layout Constraints (iOS 8+ support), inspired by [https://github.com/ustwo/autolayout-helper-swift](https://github.com/ustwo/autolayout-helper-swift)\n\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/pchelnikov/MarkerKit/blob/master/LICENSE)\n[![Platform](https://img.shields.io/cocoapods/p/MarkerKit.svg?style=flat)](https://github.com/pchelnikov/MarkerKit)\n[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/MarkerKit.svg)](https://cocoapods.org/pods/MarkerKit)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n## Requirements\n\n- iOS 8.0+\n- Xcode 9.0+\n- Swift 4.0+\n\n## Installation\n\n### CocoaPods\n\nYou can use [CocoaPods](http://cocoapods.org/?q=MarkerKit).\n\n```bash\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n  pod 'MarkerKit'\nend\n```\n\n#### Carthage \nYou can use [Carthage](https://github.com/Carthage/Carthage). \nSpecify in Cartfile:\n\n```bash\ngithub \"pchelnikov/MarkerKit\"\n```\n\nRun `carthage` to build the framework and drag the built MarkerKit.framework into your Xcode project. Follow [build instructions](https://github.com/Carthage/Carthage#getting-started).\n\n### Manually\n\n- Add the `MarkerKit.swift` file to your Xcode project.\n\n## Usage\n\n### Quick Start\n\n```swift\nimport MarkerKit\n\nclass MyViewController: UIViewController {\n\n    lazy var myView = UIView()\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        view.addSubview(myView)\n        \n        myView.mrk.height(50)\n        myView.mrk.width(50)\n        myView.mrk.center(to: view)\n    }\n}\n```\n\n### More examples:\n\n**Edges placing**\n\n```swift\n// Create view\n    \nlet myView = UIView()\nmyView.backgroundColor = UIColor.red\nview.addSubview(myView)\n    \n// Add constraints\n    \nmyView.mrk.top(to: view, attribute: .top, relation: .equal, constant: 10.0)\nmyView.mrk.leading(to: view, attribute: .leading, relation: .equal, constant: 10.0)\nmyView.mrk.trailing(to: view, attribute: .trailing, relation: .equal, constant: -10.0)\nmyView.mrk.bottom(to: view, attribute: .bottom, relation: .equal, constant: -10.0)\n```\n\nor shorter you can omit the attributes:\n\n```swift\nmyView.mrk.top(to: view, constant: 10.0)\nmyView.mrk.leading(to: view, constant: 10.0)\nmyView.mrk.trailing(to: view, constant: -10.0)\nmyView.mrk.bottom(to: view, constant: -10.0)\n```\n\nor even shorter using `fillSuperview`:\n\n```swift\nlet edgeInsets = UIEdgeInsets(top: 10.0, left: 10.0, bottom: 10.0, right: 10.0)\nmyView.mrk.fillSuperview(edgeInsets)\n```\n\n**Centering**\n\n```swift\nmyView.mrk.centerX(to: view)\nmyView.mrk.centerY(to: view)\n```\n\nor equivalent:\n\n```swift\nmyView.mrk.center(to: view)\n```\n\n**Measurements**\n\nConstraints for width and height:\n\n```swift\nmyView.mrk.width(100)\nmyView.mrk.height(100)\n```\n\n**Modify constraints**\n\n```swift\n// Create a reference to the `NSLayoutConstraint` e.g. for height\n\nlet heightConstraint = myView.mrk.height(100)\n```\n\n...\n\n```swift\n\n// Update the height constant\n\nheightConstraint.constant = 30.0\n\n// Animate changes\n\nUIView.animate(withDuration: 0.3) {\n    self.view.layoutIfNeeded()\n}\n```\n\n## What to do next\n\n* Writing tests\n\n## License\n\nMarkerKit is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpchelnikov%2Fmarkerkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpchelnikov%2Fmarkerkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpchelnikov%2Fmarkerkit/lists"}