title: How to call a delegate function from within a custom function?
body: <p>I'm using a UIPageViewController and I'm trying to call the delegate function:</p>
  
  <pre><code>    public func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) {
  }
  </code></pre>
  
  <p>from within a custom function:</p>
  
  <pre><code>func timer () {
  //Call UIPageViewController, willTransitionTo here
  }
  </code></pre>
  
  <p>Is there a way to do it?</p>