title: Custom UICollectionViewCell Auto Layout NSInternalInconsistencyException error
body: <p>I'm subclassing a UICollectionViewCell and doing all the layout in code with auto layout. This is my init method:</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame{
      frame = CGRectMake(0, 0, 403, 533);
      if (self = [super initWithFrame:frame]) {
          self.translatesAutoresizingMaskIntoConstraints = NO;
  
          PBCardPricesViewController *pricesView = [[PBCardPricesViewController alloc] init];
          [self addSubview:pricesView.view];
  
          UIImageView *background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"CardBackground"]];
          [self addSubview:background];
  
          [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-(20)-[background]|" options:0 metrics:nil views:@{@"background":background}]];
          [self addConstraint:[NSLayoutConstraint constraintWithItem:pricesView.view attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:background attribute:NSLayoutAttributeLeft multiplier:1 constant:0]];
  
          [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[background]|" options:0 metrics:nil views:@{@"background":background}]];
          [self addConstraint:[NSLayoutConstraint constraintWithItem:pricesView.view attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:background attribute:NSLayoutAttributeTop multiplier:1 constant:0]];
      }
  
      return self;
  }
  </code></pre>
  
  <p>When I comment out the translateAutoresizingMask line I get:</p>
  
  <pre><code>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:0x1d83f540 H:[UIImageView:0x1d83f950]-(0)-|   (Names: '|':PBCardViewCollectionCell:0x1d83b970 )&gt;",
  
      "&lt;NSAutoresizingMaskLayoutConstraint:0x1c55ad20 h=--&amp; v=--&amp; H:[PBCardViewCollectionCell:0x1d83b970(393)]&gt;",
  
      "&lt;NSAutoresizingMaskLayoutConstraint:0x1c559410 h=--&amp; v=--&amp; UIImageView:0x1d83f950.midX == + 191.5&gt;",
  
      "&lt;NSAutoresizingMaskLayoutConstraint:0x1c559450 h=--&amp; v=--&amp; H:[UIImageView:0x1d83f950(383)]&gt;"
  
  )
  
  
  
  Will attempt to recover by breaking constraint 
  
  &lt;NSLayoutConstraint:0x1d83f540 H:[UIImageView:0x1d83f950]-(0)-|   (Names: '|':PBCardViewCollectionCell:0x1d83b970 )&gt;
  
  
  
  Break on objc_exception_throw 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>
  
  <p>When I don't I get this error:
  <code>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UICollectionView's implementation of -layoutSubviews needs to call super.'</code>
  How do I get this to show the way I want it to? What am I missing?</p>