title: Zooming out animation Swift
body: <p>I'm trying to do some animation for a UIImageView (only zooming out)</p>
  
  <p>1- I set the frame to be bigger than the screen to make it zoomed in like so :</p>
  
  <pre><code>private lazy var imageView: UIImageView = {
      let image = UIImageView()
      image.frame = CGRect(x: 0, y: 0, width: view.frame.width + 300, height: view.frame.height + 300)
      image.center = view.center
      image.image = UIImage(named: "1111")
      image.contentMode = .scaleAspectFill
      return image
  }()
  </code></pre>
  
  <p>and I want to make the frame go back to the screen size like so :</p>
  
  <pre><code>func firstAnimation() {
      UIView.animate(withDuration: 15, animations: {
  
          // HERE 
          self.imageView.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
  
      }) { (finished) in
          self.secondAnimation()
      }
  }
  </code></pre>
  
  <p>I didn't work with me unfortunately. </p>
  
  <p>Here the full class code :
  <a href="https://gist.github.com/cs4alhaider/5399bdcdb16f3af9e388395ffbd735d3" rel="nofollow noreferrer">github</a></p>