{"id":24442533,"url":"https://github.com/frandepascuali/constraintsmonitor","last_synced_at":"2025-06-12T07:32:03.568Z","repository":{"id":56906564,"uuid":"266857556","full_name":"FranDepascuali/ConstraintsMonitor","owner":"FranDepascuali","description":"A tool to understand constraints warnings. Nicer constraints warnings, with no setup needed.","archived":false,"fork":false,"pushed_at":"2020-11-02T22:14:09.000Z","size":196,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T12:52:18.707Z","etag":null,"topics":["autolayout","constraints","constraints-warnings","ios","nslayoutconstraint","objective-c","swift","uikit","warnings"],"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/FranDepascuali.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":"2020-05-25T18:56:19.000Z","updated_at":"2024-02-22T05:02:07.000Z","dependencies_parsed_at":"2022-08-20T19:20:17.137Z","dependency_job_id":null,"html_url":"https://github.com/FranDepascuali/ConstraintsMonitor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/FranDepascuali/ConstraintsMonitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranDepascuali%2FConstraintsMonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranDepascuali%2FConstraintsMonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranDepascuali%2FConstraintsMonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranDepascuali%2FConstraintsMonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FranDepascuali","download_url":"https://codeload.github.com/FranDepascuali/ConstraintsMonitor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranDepascuali%2FConstraintsMonitor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259420513,"owners_count":22854598,"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","constraints","constraints-warnings","ios","nslayoutconstraint","objective-c","swift","uikit","warnings"],"created_at":"2025-01-20T21:59:18.325Z","updated_at":"2025-06-12T07:32:03.520Z","avatar_url":"https://github.com/FranDepascuali.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConstraintsMonitor\nA tool to understand constraints warnings, only adding it as a dependency.\n\n###\nWithout **ConstraintsMonitor**:\n```\n[LayoutConstraints] Unable to simultaneously satisfy constraints.\n\tProbably at least one of the constraints in the following list is one you don't want. \n\tTry this: \n\t\t(1) look at each constraint and try to figure out which you don't expect; \n\t\t(2) find the code that added the unwanted constraint or constraints and fix it. \n\t(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) \n(\n    \"\u003cNSAutoresizingMaskLayoutConstraint:0x600003220d20 h=--\u0026 v=--\u0026 ConstraintsMonitor_Example.MyView:0x7fcdaff03e10.height == 896   (active)\u003e\",\n    \"\u003cNSLayoutConstraint:0x600003220a50 UIView:0x7fcdaff031e0.height == 200   (active)\u003e\",\n    \"\u003cNSLayoutConstraint:0x600003220410 V:|-(0)-[UIView:0x7fcdaff031e0]   (active, names: '|':ConstraintsMonitor_Example.MyView:0x7fcdaff03e10 )\u003e\",\n    \"\u003cNSLayoutConstraint:0x600003220aa0 V:[UIView:0x7fcdaff031e0]-(0)-[UIView:0x7fcdaff03fc0]   (active)\u003e\",\n    \"\u003cNSLayoutConstraint:0x600003220b90 UIView:0x7fcdaff03fc0.bottom == ConstraintsMonitor_Example.MyView:0x7fcdaff03e10.bottom   (active)\u003e\",\n    \"\u003cNSLayoutConstraint:0x600003220be0 UIView:0x7fcdaff03fc0.height == 0.2*ConstraintsMonitor_Example.MyView:0x7fcdaff03e10.height   (active)\u003e\"\n)\n\nWill attempt to recover by breaking constraint \n\u003cNSLayoutConstraint:0x600003220a50 UIView:0x7fcdaff031e0.height == 200   (active)\u003e\n```\n\nWith **ConstraintsMonitor**:\n```\n[LayoutConstraints] Unable to simultaneously satisfy constraints.\n\tProbably at least one of the constraints in the following list is one you don't want. \n\tTry this: \n\t\t(1) look at each constraint and try to figure out which you don't expect; \n\t\t(2) find the code that added the unwanted constraint or constraints and fix it. \n\t(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) \n(\n    \"UIViewControllerWrapperView.MyView.height == 896.0 (Did you set translatesAutoresizingMaskIntoConstraints = false?)\",\n    \"MyView.UIView.height == 200.0 \",\n    \"MyView.UIView.top == UIViewControllerWrapperView.MyView.top (constant: 0.0)\",\n    \"MyView.UIView.top == UIView.bottom (constant: 0.0)\",\n    \"MyView.UIView.bottom == UIViewControllerWrapperView.MyView.bottom (constant: 0.0)\",\n    \"MyView.UIView.height == UIViewControllerWrapperView.MyView.height (multiplier: 0.200)\"\n)\n\nWill attempt to recover by breaking constraint \nMyView.UIView.height == 200.0 \n\nMake a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.\nThe methods in the UIConstraintBasedLayoutDebugging category on UIView listed in \u003cUIKitCore/UIView.h\u003e may also be helpful.\n```\n\n## Why?\nI was tired of looking for constraints issues and realizing what was really the issue, so I created this mini tool for printing nicer constraints\n\n## Installation\n\n* [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html):\n\n```ruby\npod 'ConstraintsMonitor'\n```\n\n* [Swift Package Manager](https://swift.org/package-manager/):\n\n```swift\ndependencies: [\n  .package(url: \"https://github.com/FranDepascuali/ConstraintsMonitor.git\", from: \"1.0.1\")\n]\n```\n\n## Usage\nJust by including this lib in your project, you will see nicer constraints warnings\n\n## Key Features\n* Use an identifier for the constraint if supplied.\n* Use the view identifier or the class name if the view is a subclass of UIView.\n* Show the parent view, so it's easier to know where to locate the issue.\n\n## How does it work?\nBy overriding the description property of the `NSLayoutConstraint` involved, we have a nicer way of viewing constraints.\n\n## Author\nYou can check my blog at https://deep-thought.netlify.com/ or [@FranDepascuali](https://twitter.com/FranDepascuali) in twitter.\n\n## License\nConstraintsMonitor 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%2Ffrandepascuali%2Fconstraintsmonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrandepascuali%2Fconstraintsmonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrandepascuali%2Fconstraintsmonitor/lists"}