I am getting the following in the logs when debugging the app. The view still appears and nothing is wrong. How do get rid of this constraint problem?
2019-04-08 13:51:36.006550-0400 Appy[1315:754989] [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:0x28ab90e60 UITextField:0x1082f0a00.width == 247.5 (active)>",
"<NSLayoutConstraint:0x28ab99e50 UITextField:0x1082f0a00.trailing == UITableViewCellContentView:0x10a58b840.trailingMargin - 58.5 (active)>",
"<NSLayoutConstraint:0x28ab99ea0 UITextField:0x1082f0a00.leading == UITableViewCellContentView:0x10a58b840.leadingMargin (active)>",
"<NSLayoutConstraint:0x28ab9a490 'UIView-Encapsulated-Layout-Width' UITableViewCellContentView:0x10a58b840.width == 600 (active)>",
"<NSLayoutConstraint:0x28ab99f90 'UIView-leftMargin-guide-constraint' H:|-(15)-[UILayoutGuide:0x2835bb800'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':UITableViewCellContentView:0x10a58b840 )>",
"<NSLayoutConstraint:0x28ab9a030 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x2835bb800'UIViewLayoutMarginsGuide']-(15)-|(LTR) (active, names: '|':UITableViewCellContentView:0x10a58b840 )>"
)
Would the values after the app in brackets help? Is that a line number for some generated code from the XIB?
If you give width constraint, you should not give leading and trailing. Either delete width constraint and just give leading and trailing. Or keep the width, and delete leading/trailing.
I'd recommend deleting the width constraint and keep the leading and trailing for the text field.
The error says, you have given a fixed width constraint, and at the same time you have given leading and trailing. These two cannot satisfy each other, as when you give leading and trailing, based on these two , the width of the textfield will vary.