Skip to content

Commit 79fa7eb

Browse files
committed
Temporary fix for tiling pages while inserting.
1 parent 36e67a0 commit 79fa7eb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

SCPageViewController/SCPageViewController.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ - (void)navigateToPageAtIndex:(NSUInteger)pageIndex
260260
void(^animationFinishedBlock)() = ^{
261261

262262
[self _updateNavigationContraints];
263+
[self _tilePages];
263264

264265
if(!animated && previousCurrentPage != self.currentPage && [self.delegate respondsToSelector:@selector(pageViewController:didNavigateToPageAtIndex:)]) {
265266
[self.delegate pageViewController:self didNavigateToPageAtIndex:pageIndex];
@@ -270,7 +271,7 @@ - (void)navigateToPageAtIndex:(NSUInteger)pageIndex
270271
}
271272
};
272273

273-
[self.scrollView setContentOffset:offset easingFunction:self.easingFunction duration:(animated ? self.animationDuration : 0.0f) completion:animationFinishedBlock];
274+
[self.scrollView setContentOffset:offset easingFunction:self.easingFunction duration:(animated ? self.animationDuration : 0.0f) completion:animationFinishedBlock];
274275
}
275276

276277
- (NSArray *)loadedViewControllers
@@ -477,10 +478,7 @@ - (void)_tilePages
477478
}
478479

479480
for (NSUInteger pageIndex = firstNeededPageIndex; pageIndex <= lastNeededPageIndex; pageIndex++) {
480-
if([self.insertionIndexes containsIndex:pageIndex]) {
481-
continue;
482-
}
483-
481+
484482
UIViewController *page = [self viewControllerForPageAtIndex:pageIndex];
485483
if (!page) {
486484
[self _createAndInsertNewPageAtIndex:pageIndex];

0 commit comments

Comments
 (0)