title: UICollectionViewCell Auto Layout
body: <p>I have made up a simple custom <code>UICollectionViewCell</code> in my storyboard, I also did this programatically with identical results.</p>
  
  <p>It has a singular <code>UIImageView</code> and two <code>UILabels</code>, like so:</p>
  
  <pre><code>          &lt;--UIIMAGEVIEW--&gt;          &lt;--UILABEL--------&gt;
  |-(10px)- |               | -(10px)-                     -(10px)-|
            &lt;---------------&gt;          &lt;--UILABEL--------&gt;
  </code></pre>
  
  <p>The image is sat on the left, then to the right of it are two labels above and below each other. </p>
  
  <p>Each are spaced out with 10 pixel gaps, and all centred on the cells Y axis. The labels then have a constant to offset them from the centre (up and down).</p>
  
  <p>The image has fixed height and width of 44px and the labels have a fixed height of 20px (with flexible width).</p>
  
  <p>The constraints work as expected and never break the app, but they always spit out this annoying console log info below, as they are apparently breaking.</p>
  
  <p>If I add this line to my <code>UICollectionViewCell</code> subclass, the constraints no longer break and spit out console errors, but they are totally broken onscreen.</p>
  
  <pre><code>[self.contentView setTranslatesAutoresizingMaskIntoConstraints:NO];
  </code></pre>
  
  <p>Any clues? It seems so illogical!</p>
  
  <p>Here is the console error code:</p>
  
  <pre><code>2014-10-25 18:28:14.273 Air Plan[1579:580797] 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) 
  (
      "&lt;NSLayoutConstraint:0x17009edc0 H:[UIImageView:0x1701f7d00(44)]&gt;",
      "&lt;NSLayoutConstraint:0x17009f130 H:|-(10)-[UIImageView:0x1701f7d00]   (Names: '|':UIView:0x170183810 )&gt;",
      "&lt;NSLayoutConstraint:0x17009f270 H:[UIImageView:0x1701f7d00]-(10)-[UILabel:0x155e59970'detailLbl']&gt;",
      "&lt;NSLayoutConstraint:0x17009f310 H:[UILabel:0x155e59970'detailLbl']-(10)-|   (Names: '|':UIView:0x170183810 )&gt;",
      "&lt;NSAutoresizingMaskLayoutConstraint:0x17409eff0 h=--&amp; v=--&amp; H:[UIView:0x170183810(50)]&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x17009edc0 H:[UIImageView:0x1701f7d00(44)]&gt;
  
  Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
  2014-10-25 18:28:14.276 Air Plan[1579:580797] 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) 
  (
      "&lt;NSLayoutConstraint:0x17009fcc0 H:[UIImageView:0x1701fa800(44)]&gt;",
      "&lt;NSLayoutConstraint:0x17009ff40 H:|-(10)-[UIImageView:0x1701fa800]   (Names: '|':UIView:0x170180a90 )&gt;",
      "&lt;NSLayoutConstraint:0x1702800a0 H:[UIImageView:0x1701fa800]-(10)-[UILabel:0x155e5b440'detailLbl']&gt;",
      "&lt;NSLayoutConstraint:0x170280140 H:[UILabel:0x155e5b440'detailLbl']-(10)-|   (Names: '|':UIView:0x170180a90 )&gt;",
      "&lt;NSAutoresizingMaskLayoutConstraint:0x17409ea00 h=--&amp; v=--&amp; H:[UIView:0x170180a90(50)]&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x17009fcc0 H:[UIImageView:0x1701fa800(44)]&gt;
  
  Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
  2014-10-25 18:28:14.278 Air Plan[1579:580797] 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) 
  (
      "&lt;NSLayoutConstraint:0x170280a00 H:[UIImageView:0x1701fab00(44)]&gt;",
      "&lt;NSLayoutConstraint:0x170280c80 H:|-(10)-[UIImageView:0x1701fab00]   (Names: '|':UIView:0x1701822f0 )&gt;",
      "&lt;NSLayoutConstraint:0x170280dc0 H:[UIImageView:0x1701fab00]-(10)-[UILabel:0x155e5cd10'detailLbl']&gt;",
      "&lt;NSLayoutConstraint:0x170280e60 H:[UILabel:0x155e5cd10'detailLbl']-(10)-|   (Names: '|':UIView:0x1701822f0 )&gt;",
      "&lt;NSAutoresizingMaskLayoutConstraint:0x17409f180 h=--&amp; v=--&amp; H:[UIView:0x1701822f0(50)]&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x170280a00 H:[UIImageView:0x1701fab00(44)]&gt;
  
  Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
  2014-10-25 18:28:14.280 Air Plan[1579:580797] 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) 
  (
      "&lt;NSLayoutConstraint:0x170281090 H:[UIImageView:0x1701fae00(44)]&gt;",
      "&lt;NSLayoutConstraint:0x170281310 H:|-(10)-[UIImageView:0x1701fae00]   (Names: '|':UIView:0x170182220 )&gt;",
      "&lt;NSLayoutConstraint:0x1702813b0 H:[UIImageView:0x1701fae00]-(10)-[UILabel:0x155e5d620'titleLbl']&gt;",
      "&lt;NSLayoutConstraint:0x170281400 H:[UILabel:0x155e5d620'titleLbl']-(10)-|   (Names: '|':UIView:0x170182220 )&gt;",
      "&lt;NSAutoresizingMaskLayoutConstraint:0x17409fd60 h=--&amp; v=--&amp; H:[UIView:0x170182220(50)]&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x170281090 H:[UIImageView:0x1701fae00(44)]&gt;
  
  Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
  2014-10-25 18:28:14.282 Air Plan[1579:580797] 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) 
  (
      "&lt;NSLayoutConstraint:0x170281b80 H:[UIImageView:0x1701fb100(44)]&gt;",
      "&lt;NSLayoutConstraint:0x17409f4a0 H:|-(10)-[UIImageView:0x1701fb100]   (Names: '|':UIView:0x170182150 )&gt;",
      "&lt;NSLayoutConstraint:0x17409f5e0 H:[UIImageView:0x1701fb100]-(10)-[UILabel:0x155d64210'detailLbl']&gt;",
      "&lt;NSLayoutConstraint:0x17409f680 H:[UILabel:0x155d64210'detailLbl']-(10)-|   (Names: '|':UIView:0x170182150 )&gt;",
      "&lt;NSAutoresizingMaskLayoutConstraint:0x1742800f0 h=--&amp; v=--&amp; H:[UIView:0x170182150(50)]&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x170281b80 H:[UIImageView:0x1701fb100(44)]&gt;
  
  Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
  </code></pre>