title: How can I resize a view, while proportionally resizing it's subviews?
body: <p>I'm trying to create a custom segue, where the first view controller shrinks a little and the second one slides over top of it. Here's what I have for segue implementation:</p>
  
  <pre><code>override func perform() {
      let firstView = self.sourceViewController.view as UIView!
      let secondView = self.destinationViewController.view as UIView!
      let screenSize = UIScreen.mainScreen().bounds.size
      let window = UIApplication.sharedApplication().keyWindow
  
      secondView.frame = CGRectMake(0.0, screenSize.height, screenSize.width, screenSize.height)
      window?.insertSubview(secondView, aboveSubview: firstView)
  
      UIView.animateWithDuration(2, delay: 0, options: .CurveEaseIn, animations: {
  
          // BEGIN RELEVANT PORTION
          let offset: CGFloat = 20
  
          firstView.frame = CGRectMake(offset, offset, screenSize.width - (offset * 2), screenSize.height - (offset * 2))
          firstView.autoresizesSubviews = true
          firstView.layoutIfNeeded()
          // END RELEVANT PORTION
  
      }, completion: nil)
  
      UIView.animateWithDuration(5, delay: 1, options: .CurveEaseOut, animations: {
  
          secondView.frame = CGRectMake(0.0, 0.0, screenSize.width, screenSize.height)
  
      }, completion: nil)
  }
  </code></pre>
  
  <p>This produces a result like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Ig0HJ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ig0HJ.gif" alt="gif showing the result of the above code"></a></p>
  
  <p>This is already really great, but not what I intended. I need the subviews ("Hi, I'm Matt." label and button) to resize proportionally to the superview, as if the entire view were falling down on the <em>z</em> axis.</p>
  
  <p>I am using Auto Layout.</p>
  
  <p>Thank you so much in advance!</p>