title: How to add slide animation to uiview height constant?
body: <p>I'm trying to create the effect that when scroll/swipe down, the UIView on the top of the view controller will shrink and the bottom part will expand. </p>
  
  <p>Here's my code for the swipe gesture I added to the upper view.</p>
  
  <pre><code>@IBAction func swipeUp(_ sender: UISwipeGestureRecognizer) {
          if(upperView.isHidden == false){
              upperView.isHidden = true
              self.heightUpperView.constant = 0
              self.view.layoutIfNeeded()
          }
          else{
              self.heightUpperView.constant  = 372
              upperView.isHidden = false
              self.view.layoutIfNeeded()
          }
      }
  </code></pre>
  
  <p>It works but there's lack of animation. I wonder what would be the best approach to mimic the scrolling animation or sticky header animation. </p>
  
  <p>Thank you for your help in advance.</p>