title: Toggle two views with same constraints, one is wrong aligned
body: <p>I'm trying to toggle between 2 tableviews based on a segment control. To do this, I've tested 2 implementations: </p>
  
  <p>Option A: Have 2 container views stacked in a storyboard (same constraints), then toggle the container views based on the segment control.</p>
  
  <p>Option B: Have 1 container view setup, add and remove the views programmatically.</p>
  
  <p>The problem with both implementations is that the first view to display is always aligned correctly (no matter if its view A or view B), the second one is wrong aligned! rrrr</p>
  
  <p>Why is the second view to display wrong aligned!?!?</p>
  
  <p>Here is the code for example A:</p>
  
  <pre><code>class MainViewController: UIViewController {
  
  @IBOutlet weak var viewOne: UIView!
  @IBOutlet weak var viewTwo: UIView!
  @IBOutlet weak var segmentContrl: UISegmentedControl!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      showView(0)
  }
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
  }
  
  func showView(index:Int){
  
      switch index
      {
          case 0:
              viewOne.hidden = false
              viewTwo.hidden = true
              break;
  
          case 1:
              viewOne.hidden = true
              viewTwo.hidden = false
              break;
  
          default:
  
              break;
      }
  }
  
  @IBAction func onSegmentChanged(sender: AnyObject) {
  
      print("onSegmentChanged \( segmentContrl.selectedSegmentIndex)")
      showView(segmentContrl.selectedSegmentIndex);
  }
  </code></pre>
  
  <p>Storyboard, the container views are stacked:
  <a href="https://i.stack.imgur.com/XaPPM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XaPPM.png" alt="storyboard"></a>
  The container views constraints, both have the same!
  <a href="https://i.stack.imgur.com/WOOrN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WOOrN.png" alt="constraints"></a></p>