title: Can not get button to turn uipageviewcontroller page programmatically (Using Pages extension)
body: <p>I'm fiddling with <code>uipageviewcontroller</code> and I'm trying to go to the next page by pressing a button rather than swiping. I found a neat extension on <a href="https://github.com/hyperoslo/Pages" rel="nofollow noreferrer">github called 'Pages'</a> that is supposed to be robust and easy to use, but I can't for the life of me figure this out.</p>
  
  <p>The extension itself comes with previous and next button in the navigation area but I don't want those, I want to be able to press a button on the actual screen and have it go to the next page. Has anyone had any experience with this extension?</p>
  
  <p><code>AppDelegate</code></p>
  
  <pre><code>import UIKit
  import Pages
  import Imaginary
  
  
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
  
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
      //let pages = pagesControllerInCode()
      let pages = pagesControllerInStoryboard()
  
      let navigationController = UINavigationController(rootViewController: pages)
  
      pages.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Previous Page",
        style: .plain,
        target: pages,
        action: #selector(PagesController.moveBack))
  
      pages.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next Page",
        style: .plain,
        target: pages,
        action: #selector(PagesController.moveForward))
  
      window = UIWindow(frame: UIScreen.main.bounds)
      window?.rootViewController = navigationController
      window?.makeKeyAndVisible()
  
      pages.enableSwipe = false
      pages.showBottomLine = false
  
      return true
    }
  
    private func pagesControllerInCode() -&gt; PagesController {
      var viewControllers: [UIViewController] = []
  
      for i in 0..&lt;5 {
        if let imageURL = URL(string: "https://unsplash.it/375/667/?image=\(i+10)") {
          let viewController = ViewController()
          viewController.imageView.setImage(url: imageURL)
  
          viewControllers.append(viewController)
        }
      }
  
      let pages = PagesController(viewControllers)
  
      pages.enableSwipe = false
      pages.showBottomLine = false
  
      return pages
    }
  
    private func pagesControllerInStoryboard() -&gt; PagesController {
      let storyboardIds = ["One","Two"]
  
      return PagesController(storyboardIds)
    }
  }
  </code></pre>
  
  <p><code>ViewController</code></p>
  
  <pre><code>import UIKit
  import Pages
  
  class ViewController: UIViewController {
  
    lazy var imageView = UIImageView()
  
    override func viewDidLoad() {
      super.viewDidLoad()
  
    }
  
    override func viewDidLayoutSubviews() {
      //corrects scrollview frame to allow for full-screen view controller pages
      for subView in self.view.subviews {
        if subView is UIScrollView {
          subView.frame = self.view.bounds
          subView.backgroundColor = UIColor.clear
        }
      }
      super.viewDidLayoutSubviews()
    }
  
    @IBAction func test(_ sender: UIButton) {
      NSLog("Test")
      // This is where I've been trying to figure out how to turn the page programmatically
      }
  }
  </code></pre>