Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
The first plan for this fix was just to workaround not to pass
`NSNotFound` to `selectTabAtIndex:`, but I found `selectTabAtIndex:`
doesn't take out-of-bounds arguments into account. In private methods
like `viewControllerAtIndex:` handles invalid arguments collectly so I
decided follow this way. Notice that `selectTabAtIndex:` is a public
method which behaviour will be changed by this fix.
  • Loading branch information
akisute committed Jan 19, 2014
1 parent 12f5a11 commit 7dff581
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ICViewPager/ICViewPager/ViewPagerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,11 @@ - (void)reloadData {
[self defaultSetup];
}
- (void)selectTabAtIndex:(NSUInteger)index {

if (index >= self.tabCount) {
return;
}

self.animatingToTab = YES;

// Set activeTabIndex
Expand Down

0 comments on commit 7dff581

Please sign in to comment.