I'm using a UIPageViewController as a way to swipe through the photos in a photo library. It works when photos exist, but crashes if no photos exist on the phone. The errors:
2015-04-19 16:27:05.305 MyApp[2566:1278254] *** Assertion failure in -[MyPageViewController queuingScrollView:didBailoutOfScrollAndRevealedView:], /SourceCache/UIKit/UIKit-3347.44/UIPageViewController.m:1903
2015-04-19 16:27:05.308 MyApp[2566:1278254] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No view controller managing visible view (null)'
The data source delegate methods do return nil when no photos exist, so I would have thought that the page view controller would just show nothing. Obviously, that's incorrect.
What's the proper way to handle the case when there's currently no data to display in a UIPageViewController? Fabricate a dummy page content view controller and hand it off to the page view controller, just so it has something to display?