File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'SCPageViewController'
3- s . version = '2.0.5 '
3+ s . version = '2.0.6 '
44 s . platform = :ios
55 s . ios . deployment_target = '5.0'
66
Original file line number Diff line number Diff line change @@ -1052,7 +1052,10 @@ - (void)reloadPagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated compl
10521052
10531053 [indexes enumerateIndexesWithOptions: NSEnumerationReverse usingBlock: ^(NSUInteger pageIndex, BOOL *stop) {
10541054 UIViewController *oldViewController = [self viewControllerForPageAtIndex: pageIndex];
1055- [removedViewControllers addObject: oldViewController];
1055+
1056+ if (oldViewController) {
1057+ [removedViewControllers addObject: oldViewController];
1058+ }
10561059
10571060 [oldViewController willMoveToParentViewController: nil ];
10581061 if ([self .visibleViewControllers containsObject: oldViewController]) {
@@ -1061,6 +1064,10 @@ - (void)reloadPagesAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated compl
10611064
10621065 [self .pages replaceObjectAtIndex: pageIndex withObject: [NSNull null ]];
10631066 UIViewController *newViewController = [self _createAndInsertNewPageAtIndex: pageIndex];
1067+
1068+ if ([newViewController isEqual: oldViewController]) {
1069+ [removedViewControllers removeObject: newViewController];
1070+ }
10641071
10651072 if (animated && [self .layouter respondsToSelector: @selector (animatePageReloadAtIndex:oldViewController:newViewController:pageViewController:completion: )]) {
10661073 dispatch_group_enter (animationsDispatchGroup);
You can’t perform that action at this time.
0 commit comments