I have been trying to use pageContainer.setViewControllers([displayThisViewController], direction: .forward, animated: true, completion: nil)
to turn from viewControllerA to viewControllerB. This is my implementation of it in viewControllerA:
pageViewController().setViewControllers([viewControllerB()], direction: .forward, animated: true, completion: nil)
The problem that I have run into is that whenever I try to run this line of code I receive the error
fatal error: unexpectedly found nil while unwrapping an Optional value
What am I doing wrong? Is it something in my pageViewController class? Thanks in advance.
edit: both view controllers were created in the storyboard, and embedded into the UIPageViewController
edit: I understand what the error message means but I do not understand what is causing it or how to fix it.