title: How to replace ViewController in Swift?
body: <p>I have presented ViewController1 using this code:</p>
  
  <pre><code>let vc1 = ViewController1()
  present(vc1, animated: true, completion: nil)
  </code></pre>
  
  <p>Now, I want to show ViewController2 in ViewController1.</p>
  
  <pre><code>@IBAction func buttonEvent(_ sender: UIButton) {
      let vc2 = ViewController2()
      self.present(vc2, animated: true, completion: nil)
  }
  </code></pre>
  
  <p>The problem is: I want to show the ViewContoller2 while the current ViewController is being dismissed when the button event is called.</p>
  
  <p>And I want to animation while doing this.</p>
  
  <p>Thank you.</p>