UIPageViewController incorrectly shows previous page

Originator:littlepotatosoftware
Number:rdar://13162693 Date Originated:2/6/2013
Status:Open Resolved:
Product:iPhone SDK Product Version:6.1
Classification:UI/Usability Reproducible:YES
 
Summary:  When changing the pages displayed by a UIPageViewController, an out-of-date view controller is displayed.

Steps to Reproduce:
- Create a UIPageViewController with transition style UIPageViewControllerTransitionStyleScroll.  Set its viewControllers to be a single UIViewController (doesn't matter what kind).  Set the dataSource correctly.

- At some later point, call setViewControllers again, passing in a different view controller (and direction Forward).  The dataSource at this point has been modified to just return the single new view controller, and will not return the old, initial view controller.  If animated:YES is supplied to setViewControllers, then the page view controller will incorrectly display the previous view controller when the view is swiped to the right.  The datasource method "viewControllerBeforeViewController" is not even called -- it is as if the PageVC has cached what it thinks is the right answer, and doesn't ask the dataSource.  If the second call to setViewControllers has animated:NO, then this bug does not happen, and the data source is correctly asked for a view controller before swiping to the right (i.e. displaying a new view controller to the left of the current view controller).

Expected Results:  Regardless of the state of the animated: parameter to setViewControllers, the dataSource should be asked for the correct view controller to be displayed.

Actual Results:  The correct behavior is only exhibited with animated:NO is supplied to UIPageViewController's setViewControllers: method

Regression:

Notes:

Comments

I also ran into this bug and filed it with Apple along with a sample project. Hopefully that will help the UIKit engineers get it fixed.

http://openradar.appspot.com/radar?id=3113412


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!