I have created custom view for UITableView cell. When The app runs and the UITableView gets populated I gets too much design related warning.Let me quickly share the log for design i am getting
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600000a8c530 H:[UIView:0x7fcc025a6390]-(1)-| (active, names: '|':UIView:0x7fcc025a5dc0 )>",
"<NSLayoutConstraint:0x600000a8c620 H:|-(1)-[UIView:0x7fcc025a6390] (active, names: '|':UIView:0x7fcc025a5dc0 )>",
"<NSLayoutConstraint:0x600000a8cb20 H:|-(0)-[UIView:0x7fcc025a5dc0] (active, names: '|':UITableViewCellContentView:0x7fcc025a58a0 )>",
"<NSLayoutConstraint:0x600000a8cbc0 H:[UIView:0x7fcc025a5dc0]-(0)-| (active, names: '|':UITableViewCellContentView:0x7fcc025a58a0 )>",
"<NSLayoutConstraint:0x600000a8d5c0 'UIView-Encapsulated-Layout-Width' UITableViewCellContentView:0x7fcc025a58a0.width == 0 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600000a8c530 H:[UIView:0x7fcc025a6390]-(1)-| (active, names: '|':UIView:0x7fcc025a5dc0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2020-07-16 12:52:06.760595+0500 NeverEndingApp[4395:106090] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600000a8c1c0 V:[UIView:0x7fcc025a6ad0]-(0)-| (active, names: '|':UIView:0x7fcc025a6390 )>",
"<NSLayoutConstraint:0x600000a8c260 V:|-(0)-[UIView:0x7fcc025a6ad0] (active, names: '|':UIView:0x7fcc025a6390 )>",
"<NSLayoutConstraint:0x600000a8c580 V:|-(1)-[UIView:0x7fcc025a6390] (active, names: '|':UIView:0x7fcc025a5dc0 )>",
"<NSLayoutConstraint:0x600000a8c5d0 V:[UIView:0x7fcc025a6390]-(1)-| (active, names: '|':UIView:0x7fcc025a5dc0 )>",
"<NSLayoutConstraint:0x600000a8cad0 V:|-(0)-[UIView:0x7fcc025a5dc0] (active, names: '|':UITableViewCellContentView:0x7fcc025a58a0 )>",
"<NSLayoutConstraint:0x600000a8cb70 V:[UIView:0x7fcc025a5dc0]-(0)-| (active, names: '|':UITableViewCellContentView:0x7fcc025a58a0 )>",
"<NSLayoutConstraint:0x600000a8d610 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fcc025a58a0.height == 0 (active)>"
)
Following is the view design
Now I dont know that what are the reasons which are creating the issue. Because the end result is satisfactory and as per desired.
So following I wanted to know:
- How to find out the exact issue in the design
- How to find out which view and which constraint of the view is creating problem
- Is it really important to remove these warnings since I am getting design as expected
Note: I know there are millions of threads here on SO for the similar issue but most of them are outdated and old. I am also asking it just to know the perfect way to avoid these issues and also the easy and best way to track the issue.