title: pop out animation of UIView in swift
body: <p>I am learning swift, I was successfully able to do popup animation of an <code>UIView</code> as below code but now i want to do reverse of it. i.e the way the <code>UIView</code> was animated should go back on a button click, Like the view is shrinking and then disappears.</p>
  
  <pre><code>popupView.isHidden = false
  popupInnerView.isHidden = false
  popupInnerView.transform = CGAffineTransform(scaleX: 0, y: 0)
  UIView.animate(withDuration: 1, delay: 0, options: .curveLinear, animations: {
          self.popupView.alpha = 1.0;
          self.popupInnerView.transform = .identity
  }, completion: nil)
  </code></pre>