title: Auto layout fails in UITableViewCell
body: <p>My constraints are not working inside a UITableViewCell, although there are no warnings and the layout is working in interface builder if I change between devices and do rotation.</p>
  
  <p>What did I do:</p>
  
  <p>I created a UITableViewCell called SearchResultCell. I want to layout a button on the right hand side and two labels on the left and the labels should horizontally fill the entire space until the button.</p>
  
  <p>Initially, I just placed the views there and - no matter which constraints I defined - in the simulator all views always appeared at the top left corner.</p>
  
  <p>Then I tried embedding them into stack views. The two labels into a vertical stack view which I then put together with the button into a horizontal stack view. Then I defined constraints such that the outmost stack view should fill the entire superview, i.e. I set bottom, trailing, top, and leading constraints to 0. </p>
  
  <p><a href="https://i.stack.imgur.com/HpnrV.png" rel="nofollow noreferrer">My constraints</a></p>
  
  <p>Again, in interface builder it is always shown correctly:</p>
  
  <p><a href="https://i.stack.imgur.com/UtmTE.png" rel="nofollow noreferrer">Layout works correctly in interface builder</a></p>
  
  <p>However, once launched, these constraints do not seem to be applied. </p>
  
  <p><a href="https://i.stack.imgur.com/uvY32.png" rel="nofollow noreferrer">How it looks like in simulator</a></p>
  
  <p>The only (slight) improvement is that now the button is beside the label thanks to the stack view. But no matter what I try, I cannot get the constraints working inside this UITableViewCell.</p>
  
  <p>What am I doing wrong here? I don't see it.</p>