title: NSLayoutConstraint subviews won't autoresize to fit container view
body: <p>I have a simple layout where there is a <code>containerView</code> that starts on the entire screen. Inside, I have two vertical subviews — <code>topView (green), botView (orange)</code> which need equal heights and should have 50% of the <code>containerView</code> height.</p>
  
  <p>After launch, I slide in a view (blue) from offscreen up from the bottom, causing the <code>containerView</code> to resize to a shorter height. </p>
  
  <p>What I would expect to happen is that the <code>topView</code> and <code>botView</code> would both get shorter, maintaining their even heights within the <code>containerView</code>, but what actually happens is that the inner views are not resized, despite having a constraint to do so.</p>
  
  <p><img src="https://i.stack.imgur.com/T0g1I.png" alt="enter image description here"></p>
  
  <p>Because this code has some code based constraints, and some IB ones, <a href="http://cloud.coneybeare.net/QYy9" rel="nofollow noreferrer">here</a> is a sample project to see it in action. This is the constraint which is being ignored:</p>
  
  <pre><code>NSLayoutConstraint *c1 = [NSLayoutConstraint constraintWithItem:self.topView
                                                        attribute:NSLayoutAttributeHeight
                                                        relatedBy:NSLayoutRelationEqual
                                                           toItem:self.containerView
                                                        attribute:NSLayoutAttributeHeight
                                                       multiplier:0.5f
                                                         constant:0.f];
  [self.containerView addConstraint:c1];
  </code></pre>
  
  <p>and the resize view code:</p>
  
  <pre><code>- (void)resizeViews {
  
      __weak UAViewController *weakSelf = self;
      dispatch_async(dispatch_get_main_queue(), ^{
          [UIView animateWithDuration:0.25 animations:^{
              weakSelf.slideInView.frame = CGRectMake(CGRectGetMinX(weakSelf.view.bounds),
                                                      CGRectGetMaxY(weakSelf.view.bounds) - CGRectGetHeight(weakSelf.slideInView.frame),
                                                      CGRectGetWidth(weakSelf.view.bounds),
                                                      CGRectGetHeight(weakSelf.slideInView.frame));
  
              weakSelf.containerView.frame = CGRectMake(CGRectGetMinX(weakSelf.view.bounds),
                                                        CGRectGetMinY(weakSelf.view.bounds),
                                                        CGRectGetWidth(weakSelf.view.bounds),
                                                        CGRectGetMaxY(weakSelf.view.bounds) - CGRectGetHeight(weakSelf.slideInView.frame));
  
          }];
      });
  
  }
  </code></pre>
  
  <p>What am I doing wrong here?</p>