When scrolling with bouncing to first/last page of UIPageViewController, viewControllers array contains wrong controller

Originator:idelgado
Number:rdar://29435577 Date Originated:30/11/2016
Status:Duplicate of 23856708 Resolved:No
Product:iOS + SDK Product Version:
Classification: Reproducible:Always
 
When observing viewControllers content of UIPageViewController from delegate's method `pageViewController:didFinishAnimating:previousViewControllers:transitionCompleted:` we can see that it contains the wrong controller when scrolling to the first/last page with bouncing (it happens on UIPageViewControllers that are not full screen width)

Steps to Reproduce:
I provide a sample project where this can be easily reproduced:
1. Run project PageControllerScrollIssue on iPad simulator
2. Drag page controller from the right side and scroll to the left until it bounces

You can also reproduce by running UI tests provided with the project.

Expected Results:
When scrolling with bouncing to first/last page, I expect to see the page control updated reflecting the page you end in.

Actual Results:
The page control is not updated.

Version:
iOS 9 and iOS 10

Notes:
It looks this has already been reported, see https://openradar.appspot.com/23856708

Configuration:


Attachments:
'PageControllerScrollIssueProject.zip' and 'pageviewcontroller-scrolling-issue.gif' were 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!