evadne / RAPageViewController

Sliding pages side by side, infinitely. Fancy parts from the redacted bits, re-implemented for expressiveness at expense of some naïvety
77 stars 5 forks source link

RAPageViewController setViewControllers: doesn't set current view controller properly #1

Closed proxi closed 2 years ago

proxi commented 11 years ago

Thank you for such an useful controller. I used it as a 5.0-compatible replacement for UIPageViewController with scroll transition.

I am displaying a collection of photos and need to move to a photo at a given index before displaying the controller. I could do that calling setViewControllers:@[controllerToMoveTo], but it doesn't work. I didn't investigate in detail, but it seems that is because contentOffset is not set properly.

Adding:

[self.scrollView setContentOffset:[self currentPageRect].origin];

before:

[self.scrollView setNeedsLayout];

in setViewControllers: solved this issue.

evadne commented 11 years ago

I think it is pretty harmless to merge. Queued.