Autolayout shows warning message - ios

i have some Problems with autolayout. Everything gets shown correct and everything works fine but i get some Warning Message in the Command Line:
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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't
understand, refer to the documentation for the UIView
property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0xb6a60f0 H:[UIImageView:0xb645e40(75)]>",
"<NSLayoutConstraint:0xb6d0e90 H:[UIView:0xb6c7350(220)]>",
"<NSLayoutConstraint:0xb6aaea0 H:|-(10)-[UIImageView:0xb645e40] (Names: '|':UITableViewCellContentView:0xb6c1590 )>",
"<NSLayoutConstraint:0xb6c85c0 H:[UIView:0xb6c7350]-(7)-| (Names: '|':UITableViewCellContentView:0xb6c1590 )>",
"<NSLayoutConstraint:0xb6d2270 H:[UIImageView:0xb645e40]-(8)-[UIView:0xb6c7350]>",
"<NSAutoresizingMaskLayoutConstraint:0xb6abd20 h=--& v=--& H:[UITableViewCellContentView:0xb6c1590(300)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0xb6d0e90 H:[UIView:0xb6c7350(220)]>
Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView
listed in <UIKit/UIView.h> may also be helpful.
This is how my nib File looks:
As you can see its a TableViewCell and i´m using a View (Sample Text) with a TextView(for iOS7) and a AttributedTextView (for iOS6)!
Whats the Problem?

The problem is that you have conflicting constraints... Auto Layouts can be a pain in the .... sometimes.
When this happens to me, i usually clear all the constraints, and start all over by choosing clear all constraints.
You can also choose to "Add missing constraints" after that, and hope that XCode will automatically know what you want to do.. actually it's a 50-50 chance that XCode will get it right.
From your screen shot, it looks like you have too many constraints, so another option will be to try to remove then one by one, and to catch those "conflicting" constraints.

Set for each view translatesAutoresizingMaskIntoConstraints = NO; That is what he is trying to tell you. During runtime you have your contraints and the generic ones. Guess we will see this property switching to NO as default in a upcomming iOS version.

Related

UITextField not showing up on View Controller

I've added a simple UITextView and i placed it where i want to in the storyboard, then i click on add missing contraints/reset to suggested and it doesn't show up on the screen when i run it, i don't know why its not working
this is what i get in the debugger.
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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<_UILayoutSupportConstraint:0x15ed61540 V:[_UILayoutGuide:0x15eee5f50(20)]>",
"<_UILayoutSupportConstraint:0x15ed0c500 V:|-(0)-[_UILayoutGuide:0x15eee5f50] (Names: '|':UIView:0x15eee5df0 )>",
"",
"",
"" )
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful.
Using the "add suggested constraint" is usually not a good idea. I really recommend that you study more about auto-layout and adaptive layout. I'd need to know exactly how you want to position and size you UITextField to determine what is the conflicting constraint for your case, it would be important to know what other views you have in your view controller that might be affecting the text field.

What are these warnings in my console?

I am having the following error in my console.I don't know what are they.
2015-03-24 13:57:43.213 automobile[5454:530574] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x174284880 V:[_UILayoutGuide:0x1741b8e20]-(238)-[UIButton:0x12ee424c0'Retry']>",
"<NSLayoutConstraint:0x174284740 V:[UIButton:0x12ee424c0'Retry']-(236)-[_UILayoutGuide:0x1741b8f00]>",
"<_UILayoutSupportConstraint:0x1740aeb80 V:[_UILayoutGuide:0x1741b8e20(50.66)]>",
"<_UILayoutSupportConstraint:0x1740aebe0 V:|-(0)-[_UILayoutGuide:0x1741b8e20] (Names: '|':UIView:0x174185bd0 )>",
"<_UILayoutSupportConstraint:0x1740aee80 V:[_UILayoutGuide:0x1741b8f00(0)]>",
"<_UILayoutSupportConstraint:0x1740aee20 _UILayoutGuide:0x1741b8f00.bottom == UIView:0x174185bd0.bottom>",
"<NSLayoutConstraint:0x174289d30 'UIView-Encapsulated-Layout-Height' V:[UIView:0x174185bd0(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x174284880 V:[_UILayoutGuide:0x1741b8e20]-(238)-[UIButton:0x12ee424c0'Retry']>
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.
Anyone who know this?Any Help?
It seems you have conflicting constraints on your views.
If you are using Interface Builder, I suggest your click on the Red or Yellow arrows in your VC scene and Xcode should give you more details as to what constraints are causing the issue.
You can see here http://i.stack.imgur.com/5lbp8.png and here http://i.stack.imgur.com/qjvFL.png how this should appear in Xcode.
I suggest you start by reconsidering the constraints and try to keep the minimum that satisfy your layout.
I hope this helps

iOS: Unable to simultaneously satisfy constraints

I've seen the common response to this question of not having constraints set up properly. However, I've worked through all of the ambiguities in Interface Builder, and all constraints seem OK. I'm not sure what to check next. I can't even tell where it is coming from. I'm not setting any constraints in code.
What can I do to figure out where it is coming form?
What can be the cause if Interface Builder doesn't report any ambiguities?
Here's the specific error:
2014-06-28 19:54:36.070 Prayer Feed[4497:60b] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x178290360 H:[UIImageView:0x13ee32490(20)]>",
"<NSLayoutConstraint:0x1782904f0 UITableViewCellContentView:0x178166840.centerX == UIImageView:0x13ee32490.centerX + 62>",
"<NSLayoutConstraint:0x178290540 H:|-(52)-[UIImageView:0x13ee32490] (Names: '|':UITableViewCellContentView:0x178166840 )>",
"<NSAutoresizingMaskLayoutConstraint:0x170286d60 h=--& v=--& H:[UITableViewCellContentView:0x178166840(247)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x178290360 H:[UIImageView:0x13ee32490(20)]>
I know the two place in code where I have a UIImageView constrained to 20x20, but again, IB tells me everything is fine.
This is the part where the problem is:
<NSAutoresizingMaskLayoutConstraint:0x170286d60 h=--& v=--& H:[UITableViewCellContentView:0x178166840(247)]>
This mask needs to be turned off.
I think that mask is off by default for IB elements that have constraints. So I assume you made something in code. You can turn it off in code like this:
contentView.translatesAutoresizingMaskIntoConstraints = NO
If this is really all IB only then I would like to know what code you use around creating table cells.

Auto Layout is enabled on storyboard but I am still getting AutolayoutMaskContraints

I am trying to do a pure auto layout constraint based app, no autoresizing, and in my storyboard I turn on the flag "Use Auto Layout" in the Xcode 5 File Attributes for the Storyboard and yet I am still getting exceptions. I don't turn on translatesAutoresizingMaskIntoConstraints anywhere in the code. It is my understanding that IB will disable translatesAutoresizingMaskIntoConstraints if auto layout is turned on. Any ideas?
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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0xdca62c0 V:[_UILayoutGuide:0xdca7310]-(201)-[UIView:0xcc69170]>",
"<NSLayoutConstraint:0xdca63e0 V:[UIView:0xcc69170]-(112)-[_UILayoutGuide:0xdc51f50]>",
"<_UILayoutSupportConstraint:0xdc581e0 V:[_UILayoutGuide:0xdca7310(52)]>",
"<_UILayoutSupportConstraint:0xdc97780 V:|-(0)-[_UILayoutGuide:0xdca7310] (Names: '|':UIView:0xdca7240 )>",
"<_UILayoutSupportConstraint:0xdc7e3b0 V:[_UILayoutGuide:0xdc51f50(32)]>",
"<_UILayoutSupportConstraint:0xdc7df20 _UILayoutGuide:0xdc51f50.bottom == UIView:0xdca7240.bottom>",
"<NSAutoresizingMaskLayoutConstraint:0xdcce0c0 h=--& v=--& V:[UIView:0xdca7240(320)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0xdca62c0 V:[_UILayoutGuide:0xdca7310]-(201)-[UIView:0xcc69170]>
Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
It seems that the root view controller for a view has the translatesAutoresizingMaskIntoConstraints turned on all the time. You can see this in the xml in the storyboard file. All the subviews however have the translatesAutoresizingMaskIntoConstraints off. I suspect this is normal behavior, but a bit confusing if you are expecting no translations to occur.

Unable to simultaneously satisfy constraints, will attempt to recover by breaking constraint

Below is the error message I receive in the debug area. It runs fine and nothing is wrong except that I receive this error. Would this prevent apple accepting the app? How do I fix it?
2012-07-26 01:58:18.621 Rolo[33597:11303] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x887d630 h=--& v=--& V:[UIButtonLabel:0x886ed80(19)]>",
"<NSAutoresizingMaskLayoutConstraint:0x887d5f0 h=--& v=--& UIButtonLabel:0x886ed80.midY == + 37.5>",
"<NSAutoresizingMaskLayoutConstraint:0x887b4b0 h=--& v=--& V:[UIButtonLabel:0x72bb9b0(19)]>",
"<NSAutoresizingMaskLayoutConstraint:0x887b470 h=--& v=--& UIButtonLabel:0x72bb9b0.midY == - 0.5>",
"<NSLayoutConstraint:0x72bf860 V:[UILabel:0x72bf7c0(17)]>",
"<NSLayoutConstraint:0x72c2430 UILabel:0x72bfad0.top == UILabel:0x72bf7c0.top>",
"<NSLayoutConstraint:0x72c2370 UILabel:0x72c0270.top == UILabel:0x72bfad0.top>",
"<NSLayoutConstraint:0x72c22b0 V:[UILabel:0x72bf7c0]-(NSSpace(8))-[UIButton:0x886efe0]>",
"<NSLayoutConstraint:0x72c15b0 V:[UILabel:0x72c0270]-(NSSpace(8))-[UIRoundedRectButton:0x72bbc10]>",
"<NSLayoutConstraint:0x72c1570 UIRoundedRectButton:0x72bbc10.baseline == UIRoundedRectButton:0x7571170.baseline>",
"<NSLayoutConstraint:0x72c21f0 UIRoundedRectButton:0x7571170.top == UIButton:0x886efe0.top>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x72bf860 V:[UILabel:0x72bf7c0(17)]>
Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
I would recommend to debug and find which constraint is "the one you don't want". Suppose you have following issue:
Always the problem is how to find following Constraints and Views.
There are two solutions how to do this:
DEBUG VIEW HIERARCHY (Do not recommend this way)
Since you know where to find unexpected constraints (PBOUserWorkDayHeaderView) there is a way to do this fairly well. Let's find UIView and NSLayoutConstraint in red rectangles. Since we know their id in memory it is quite easy.
Stop app using Debug View Hierarchy:
Find the proper UIView:
The next is to find NSLayoutConstraint we care about:
As you can see, the memory pointers are the same. So we know what is going on now. Additionally you can find NSLayoutConstraint in view hierarchy. Since it is selected in View, it selected in Navigator also.
If you need you may also print it on console using address pointer:
(lldb) po 0x17dce920
<UIView: 0x17dce920; frame = (10 30; 300 24.5); autoresize = RM+BM; layer = <CALayer: 0x17dce9b0>>
You can do the same for every constraint the debugger will point to you:-) Now you decide what to do with this.
PRINT IT BETTER (I really recommend this way, this is of Xcode 7)
set unique identifier for every constraint in your view:
create simple extension for NSLayoutConstraint:
SWIFT:
extension NSLayoutConstraint {
override public var description: String {
let id = identifier ?? ""
return "id: \(id), constant: \(constant)" //you may print whatever you want here
}
}
OBJECTIVE-C
#interface NSLayoutConstraint (Description)
#end
#implementation NSLayoutConstraint (Description)
-(NSString *)description {
return [NSString stringWithFormat:#"id: %#, constant: %f", self.identifier, self.constant];
}
#end
build it once again, and now you have more readable output for you:
once you got your id you can simple tap it in your Find Navigator:
and quickly find it:
HOW TO SIMPLE FIX THAT CASE?
try to change priority to 999 for broken constraint.
The problem you're having is the NSAutoresizingMaskLayoutConstraints should not be in there. This is the old system of springs and struts. To get rid of it, run this method on each view that you're wanting to constrain:
[view setTranslatesAutoresizingMaskIntoConstraints:NO];
Be careful, that you do not use more than one constraint in the same direction and type.
For example:
Vertical constraint for trailing = 15 and another one is >= 10.
Sometimes, Xcode creates some constraints you don't notice.
You have to get rid of redundant constraints and the log warning will surely disappear.
Additionaly, you can read and detect some certain reasons, directly from the log:
NSLayoutConstraint:0xa338390 V:|-(15)-[UILabel:0xa331260] (Names:
'|':UILabel:0xa330270 )>
This we can read as problem in UILabel constraint, it is leading vertical constraint being 15pt long.
NSLayoutConstraint:0x859ab20 H:-(13)-|[UIView:0x85a8fb0]...
This would be trailing horizontal constraint etc.
use swift this code
view.translatesAutoresizingMaskIntoConstraints = false
I had quite a number of these exceptions thrown, the fastest and easiest way I found to solve them was to find unique values in the exceptions which I then searched for in the storyboard source code. This helped me to find the actual view(s) and constraint(s) causing the problem (I use meaningful userLabels on all of the views, which makes it a lot easier to track the constraints and views)...
So, using the above exceptions I would open the storyboard as "source code" in xcode (or another editor) and look for something I can find...
<NSLayoutConstraint:0x72bf860 V:[UILabel:0x72bf7c0(17)]>
.. this looks like a vertical (V) constraint on a UILabel with a value of (17).
Looking through the exceptions I also find
<NSLayoutConstraint:0x72c22b0 V:[UILabel:0x72bf7c0]-(NSSpace(8))-[UIButton:0x886efe0]>
Which looks like the UILabel(0x72bf7c0) is close to a UIButton(0x886efe0) with some vertical spacing (8)..
That will hopefully be enough for me to find the specific views in the storyboard source code (probably by searching the text for "17" initially), or at least a few likely candidates. From there I should be able to actually figure out which views these are in the storyboard which will make it a lot easier to identify the problem (look for "duplicated" pinning or pinning that conflicts with size constraints).
I had a hard time figuring out what constraints were causing this error. Here is a simpler way to do it.
I'm using Xcode 6.1.1
"Command + A" to select all the UILabels, UIImages etc.
Click Editor -> Pin > (Select...) to Superview
again click Editor -> Resolve Auto Layout Issues -> Add Missing Constraints or Reset to Suggested Constraints. It depends on your case.
I had this issue because my .xib files were using autolayout.
In the file inspector, first tab. Unticking "Use Autolayout" solved the problem.
Here is my experience and Solution.
I didn't touched code
Select view (UILabel, UIImage etc)
Editor > Pin > (Select...) to Superview
Editor > Resolve Auto Layout Issues > Add Missing Constraints
I have followed SO questions and answers from each search query. But they all are related with specific one.
At the basic, I mean before you are going to write down a format (may be a simple one) it will gives you a warnings.
From iOS 8.0 by default views are size classes. Even if you disable size classes it will still contains some auto layout constraints.
So if you are planning to set constrains via code using VFL. Then you must take care of one below line.
// Remove constraints if any.
[self.view removeConstraints:self.view.constraints];
I had search a lot in SO, but the solution was lies in Apple Sample Code.
So you must have to remove default constraints before planning to add new one.
For me the main reason of this problem was that I forgot to uncheck AutoLayout in the Xib editor.
In fact, I did a lot of adjustments of the XIB in code.
for(UIView *view in [self.view subviews]) {
[view setTranslatesAutoresizingMaskIntoConstraints:NO];
}
This helped me catch the view causing the problem.
None of the foregoing answers is helpful in my situation. I am running XCode 10.1 and testing my app on the simulator for an "iPad (5th generation)". The simulator is running iOS 12.1.
I've got a simple root view in my storyboard, with two UITextField subviews. There are no constraints being used in the storyboard at all. And I have no UIButtonBarView objects in the app or the storyboard.
No messages get printed when the app launches and lays the root view out. None when the simulated device is rotated.
But in the simulator, the moment I click on one of the text fields, the keyboard extension arises from the bottom of the screen, although not the full keyboard, which never seems to show up in the simulator. But the following is printed out on the terminal:
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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x6000034e7700 h=--& v=--& UIKeyboardAssistantBar:0x7f9c7d714af0.height == 0 (active)>",
"<NSLayoutConstraint:0x6000034aba20 V:|-(0)-[_UIUCBKBSelectionBackground:0x7f9c7d51ec70] (active, names: '|':_UIButtonBarButton:0x7f9c7d51de40 )>",
"<NSLayoutConstraint:0x6000034aba70 _UIUCBKBSelectionBackground:0x7f9c7d51ec70.bottom == _UIButtonBarButton:0x7f9c7d51de40.bottom (active)>",
"<NSLayoutConstraint:0x6000034fb3e0 V:|-(0)-[_UIButtonBarStackView:0x7f9c7d715880] (active, names: '|':UIKeyboardAssistantBar:0x7f9c7d714af0 )>",
"<NSLayoutConstraint:0x6000034fb750 V:[_UIButtonBarStackView:0x7f9c7d715880]-(0)-| (active, names: '|':UIKeyboardAssistantBar:0x7f9c7d714af0 )>",
"<NSLayoutConstraint:0x6000034abc00 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x7f9c7d51de40.height == UILayoutGuide:0x600002ef4e00'UIViewLayoutMarginsGuide'.height (active)>",
"<NSLayoutConstraint:0x6000034d7cf0 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x600002ef4e00'UIViewLayoutMarginsGuide']-(9)-| (active, names: '|':_UIButtonBarStackView:0x7f9c7d715880 )>",
"<NSLayoutConstraint:0x6000034d7c50 'UIView-topMargin-guide-constraint' V:|-(10)-[UILayoutGuide:0x600002ef4e00'UIViewLayoutMarginsGuide'] (active, names: '|':_UIButtonBarStackView:0x7f9c7d715880 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000034aba70 _UIUCBKBSelectionBackground:0x7f9c7d51ec70.bottom == _UIButtonBarButton:0x7f9c7d51de40.bottom (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
It certainly appears to me that all this has to do with nothing in my app, and everything to do with how Apple is creating its own keyboard view, even with my small extension declared to be combined with it.
So the question remains, is there something I as an app developer am responsible for doing (on the presumption this is a bunch of stuff worth attending to) or is it just Apple's own problem/bug?
FWIW, this constraint problem message doesn't occur when simulating a newer iPad model, such as the iPad Pro 12.9-inch (3rd generation). But the message does show up when simulating an iPad Pro 9.7-inch". All claiming they're running iOS 12.1.
I am getting this same error, but only on a specific view, when I touch the first textfield, and then the next textfield down.
I am writing in SwiftUI for iOS 13.4
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:0x2809b6760 'assistantHeight' TUISystemInputAssistantView:0x105710da0.height == 44 (active)>",
"<NSLayoutConstraint:0x2809ccff0 'assistantView.bottom' TUISystemInputAssistantView:0x105710da0.bottom == _UIKBCompatInputView:0x10525ae10.top (active)>",
"<NSLayoutConstraint:0x2809cccd0 'assistantView.top' V:|-(0)-[TUISystemInputAssistantView:0x105710da0] (active, names: '|':UIInputSetHostView:0x105215010 )>",
"<NSLayoutConstraint:0x2809ca300 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x10525ae10] (active, names: '|':UIInputSetHostView:0x105215010 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x2809ccff0 'assistantView.bottom' TUISystemInputAssistantView:0x105710da0.bottom == _UIKBCompatInputView:0x10525ae10.top (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
One thing to watch out for (at least this tripped me up) was that I was removing the constraint from the wrong view. The constraint I was trying to remove was not a child constraint of my view so when I did
myView.removeConstraint(theConstraint)
it wasn't actually removing anything because I needed to call
myView.superView.removeConstraint(theConstraint)
since the constraint was technically sibling constraint of my view.
I was also getting the same issue of breaking constraints in the log, for a viewCircle in the xib. I almost tried everything listed above and nothing was working for me.
Then I tried to change the priority of the Height constraint which was breaking in the log(confirmed by adding an identifiers for the constraints on the xib)enter image description here
Basically, you just have to remove that constraint from the associated view. For instance, if is the height constraint giving warning, just remove it from your view; it will not affect the view.
swift 4
I just add this line in viewDidLoad and work fine with me.
view.removeConstraints(view.constraints)

Resources