viewControllers property of UIPageViewController is out of sync with what is actually displayed on screen.

Originator:radchencko.v.i
Number:rdar://23856708 Date Originated:11.12.2015
Status:Open Resolved:No
Product:iOS SDK Product Version:
Classification: Reproducible:
 
Summary:
In attachment you can find test project, video, log and screenshots.

Test project is based on template Page-Based Application. 
UILabel was added to display current value of viewControllers property of UIPageViewController.

On video and screenshots you may see the case when UIPageViewController displays one controller (January), but viewControllers property contains another one (February).

In TestLog.rtf file lines in red highlights swipe transition which resulted in invalid state of viewControllers property: it starts from January and ends on January (which is a bug), but UIPageViewController displays February.
Lines in blue highlights next transition: it starts from January (visible screen is February) and ends on January.

Steps to Reproduce:
Given UIPageViewController with 2 (or more) pages configured with UIPageViewControllerTransitionStyleScroll.

For example, if we have 2 pages: A and B

Normal  behaviour:
1. Initially viewControllers property contains visible view controller (A)
2. Swipe to next page (B)
3. In the end of transition viewControllers property will contain controller  (B).

Invalid  behaviour:
4. Visible page (B)
5. Start swipe to previous page (A)
6. Do not release first finger and continue swipe with another finger until page (A) will be fully visible and scroll view starts bouncing.
7. Release both fingers.
8. UIPageViewController will finish animation to page (A), but  viewControllers property will still contain controller  (B).

*See video file


Expected Results:
1. viewControllers property of UIPageViewController  always contains currently visible controller.

2. UIPageViewController returns correct view controllers in delgate callback 
pageViewController:didFinishAnimating:previousViewControllers:transitionCompleted:

Actual Results:
viewControllers property of UIPageViewController  may contain controller which was shown previously, not the one which is currently on screen.

Version:
iOS 9.1, iOS 9.0

Notes:


Configuration:
iPhone 6 64GB, iPhone 6s+ 16Gb

Attachments:
'TestPages.zip' was successfully uploaded.

Comments


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!