Skip to content

Commit 3613b89

Browse files
committed
Attempt at fixing #28 - Flickering when removing a previous page's ViewController
1 parent 0c3626e commit 3613b89

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SCPageViewController/SCPageViewController.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ - (void)insertPagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated compl
11771177
}];
11781178

11791179
void(^updateLayout)() = ^{
1180-
if(shouldAdjustOffset && self.pagingEnabled) {
1180+
if(shouldAdjustOffset) {
11811181
[self _blockContentOffsetOnPageAtIndex:(self.currentPage + indexes.count)];
11821182
}
11831183
[self _updateBoundsAndConstraints];
@@ -1247,7 +1247,7 @@ - (void)deletePagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated compl
12471247
dispatch_group_leave(animationsDispatchGroup);
12481248
}];
12491249

1250-
if(shouldAdjustOffset && self.pagingEnabled) {
1250+
if(shouldAdjustOffset) {
12511251
dispatch_group_enter(animationsDispatchGroup);
12521252
[UIView animateWithDuration:self.animationDuration animations:^{
12531253

@@ -1270,7 +1270,7 @@ - (void)deletePagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated compl
12701270

12711271
// Update the content offset and pages layout
12721272
void (^updateLayout)() = ^{
1273-
if(shouldAdjustOffset && self.pagingEnabled) {
1273+
if(shouldAdjustOffset) {
12741274
[self _blockContentOffsetOnPageAtIndex:(self.currentPage - indexes.count)];
12751275
}
12761276

@@ -1365,7 +1365,7 @@ - (void)movePageAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex animat
13651365
}
13661366

13671367
// Update the scrollView's offset
1368-
if(shouldAdjustOffset && self.pagingEnabled) {
1368+
if(shouldAdjustOffset) {
13691369
[self _blockContentOffsetOnPageAtIndex:self.currentPage];
13701370
}
13711371

@@ -1384,7 +1384,7 @@ - (void)movePageAtIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex animat
13841384

13851385
dispatch_group_notify(animationsDispatchGroup, dispatch_get_main_queue(), ^{
13861386

1387-
if(shouldAdjustOffset && self.pagingEnabled) {
1387+
if(shouldAdjustOffset) {
13881388
if(fromIndex < toIndex) {
13891389
[self _blockContentOffsetOnPageAtIndex:(self.currentPage - 1)];
13901390
} else {

0 commit comments

Comments
 (0)