title: Storyboard auto layout places view in table cell with fixed trailing-to-superview constraint to far left
body: <p>I placed an <code>UIImageView</code> at the right side of a table view cell and added a trailing constraint to the cell of 20.</p>
  <p>Yet the image ends all the way at the left of the cell when I run the app.</p>
  <p>My table view controller code is very basic:</p>
  <pre><code>override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell
  {
      let cell = tableView.dequeueReusableCell(withIdentifier: &quot;SailboatCell&quot;, for: indexPath) as! SailboatTableViewCell
  
      return cell
  }
  </code></pre>
  <p>The identifier is correct and I also set the class of cell.</p>
  <p>I've done auto layout a lot and have no idea what I could be missing here.</p>
  <p>On a device the images are on the right side when the app starts but end up on the left on newly created cells when I start scrolling.  Things reset themselves a bit when I put the device in landscape and then portrait again.</p>
  <p>No auto layout warnings are printed.</p>
  <p>Earlier I had other UI elements on the cell that were nicely placed (left-to-right) as expected. Only the image view acted weird. I deleted all other UI elements to avoid any interference.</p>
  <p><a href="https://i.stack.imgur.com/mZY6D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mZY6D.png" alt="enter image description here" /></a></p>
  <p>EDIT: I've recreated the cell and all is fine know. No idea what is was.</p>