title: Sliding UIView onto screen will not center unless a modal view is shown overtop
body: <p>I have a UIView (slidingView2) that I am sliding onto the the screen. I have set the slidingView2 to be centered on the screen horizontally. When the sliding on the screen happens the view ends up not being in the horizontal center, but rather 10 pixels to the right, partially off screen.</p>
  
  <p>But if I show any other modal view above this screen then close the modal view the slidingView2 is in the center of the screen.</p>
  
  <p>This is built with storyboards and constraints.</p>
  
  <p>Its like showing the modal view makes the slidingView2 redraw and then puts it in the correct position?  </p>
  
  <p>The other weird thing is the modal screen can be shown at anytime anywhere. What I mean by this is, my slidingView2 is the 2nd view I slide onto the screen. If I show a random modal screen as soon as the app launches then show slidingView_1 then slidingView2 then slidingView2 is centered correctly. Or if I remove the modal screen from the app launch and show it after slidingView_1 but before slidingView2 then slidingView2 is centered correctly. So as long as any modal screen is shown anytime before slidingView2, then slidingView2 will center correctly.</p>
  
  <p>Anyone have any suggestions?</p>
  
  <p>EDIT:</p>
  
  <p>My options at this pointa are to show a transpartent modal view and then take it away (i.e. giant ugly hack).</p>
  
  <p>Or call some method that makes the view redraw entirely. I tried both of these and neither work.</p>
  
  <pre><code>    [self.view setNeedsLayout];
      [self.view layoutIfNeeded];
  </code></pre>
  
  <p>Anyone know how to make a view redraw immediately?</p>
  
  <p>Other code:
  //HERE I CREATE THE VIEW BUT OFF SCREEN</p>
  
  <pre><code>-(void)willCreateAndSetupPickLocView {
  
  self.pickLocationView.alpha = 0.0f;
  [self willSetupUIForPickLocation];
  
  self.confirmPickupLocationViewLeftsideConstraint.constant = 380.0;
  [self.view setNeedsUpdateConstraints];
  
  [UIView animateWithDuration:0.0f animations:^{
  
      [self.view layoutIfNeeded];
  
  }];
  }
  </code></pre>
  
  <p>// THIS IS HOW IT IS SHOWN ONCE I ANIMATE IT</p>
  
  <pre><code>   -(void)showSetPickupHoverView {
  
  self.pickLocationView.alpha = 1.0f;
  [self layoutBackButton];
  
  if(nil == self.pickLocationView) {
  
      [self willCreateAndSetupPickLocView];
  }
  
  
  self.confirmPickupLocationViewLeftsideConstraint.constant = 10.0f;
  [self.view setNeedsUpdateConstraints];
  
  [UIView animateWithDuration:0.7f animations:^{
      [self.view layoutIfNeeded];
      self.pinMarkerView.hidden = NO;
  }];
  }
  </code></pre>