diff --git a/SYPaginator/SYPaginatorView.m b/SYPaginator/SYPaginatorView.m index 21e2017..2a2b96a 100644 --- a/SYPaginator/SYPaginatorView.m +++ b/SYPaginator/SYPaginatorView.m @@ -28,6 +28,7 @@ @implementation SYPaginatorView { NSMutableDictionary *_reuseablePages; BOOL _pageControlUsed; BOOL _pageSetViaPublicMethod; + BOOL _pageContentNeedsRefresh; } @synthesize scrollView = _scrollView; @@ -155,6 +156,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview { #pragma mark - Managing data - (void)reloadData { + _pageContentNeedsRefresh = YES; [self reloadDataRemovingCurrentPage:YES]; } @@ -402,7 +404,7 @@ - (void)_reusePages { - (void)_setCurrentPageIndex:(NSInteger)targetPage animated:(BOOL)animated scroll:(BOOL)scroll forcePreload:(BOOL)forcePreload { - if (_currentPageIndex == targetPage && _pageSetViaPublicMethod != YES) { + if (_currentPageIndex == targetPage && _pageSetViaPublicMethod != YES && _pageContentNeedsRefresh != YES) { return; } @@ -449,6 +451,7 @@ - (void)_setCurrentPageIndex:(NSInteger)targetPage animated:(BOOL)animated scrol } _pageSetViaPublicMethod = NO; + _pageContentNeedsRefresh = NO; }