title: UIPageViewController between two UIViewControllers
body: <p>I've just started programming in Swift, what I'm trying to accomplish is a very simple app with an initial <code>UIViewController</code>, a <code>UIPageViewController</code> that shows some book pages and a destination <code>UIViewController</code>.</p>
  
  <p>My approach so far is this:</p>
  
  <ol>
  <li>The <code>UIViewController1</code> is loaded and has a showPage button that simply shows <code>UIPageViewController</code>  </li>
  </ol>
  
  <p><code>present(walkthroughViewController, animated: true, completion: nil)</code></p>
  
  <ol start="2">
  <li><p>When the user reaches the last page of the <code>UIPageViewController</code>, I show the destination <code>UIViewController2</code>, addressing the segue from the start <code>UIViewController</code></p>
  
  <pre><code>override func onUIPageViewControllerRigthClosing(){
      let pvc = self.presentingViewController as! StartPageController
      dismiss(animated: true){
          pvc.performSegue(withIdentifier: "startTest", sender: nil)
      }
  }
  </code></pre></li>
  </ol>
  
  <p>Everything works correctly, but the problem is that when <code>UIPageViewController</code> is dismissed, the Starting <code>UIViewController</code> is showed and then is showed the second with the animated segue. 
  What I am trying to achieve is to directly display the target <code>UiViewController</code> to the user on the dismiss of the <code>UIPageViewController</code>, without showing the transition with animation from start View to the destination View.</p>
  
  <p>I'm completely wrong approaching or there is a way to do the segue before dismissing the <code>UIPageViewController</code>?</p>
  
  <p>Here I created a gif that shows the problem, when I close the <code>UIPageViewController</code> I see the previous view in transition: <a href="https://i.imgur.com/JFWoutq.gif" rel="nofollow noreferrer">GIF demo</a> </p>