Skip to content

Commit

Permalink
Merge pull request #13 from ebizboy/master
Browse files Browse the repository at this point in the history
Overrides sizeThatFits:  instead of sizeToFit
  • Loading branch information
jerryhjones committed Sep 9, 2013
2 parents bc08308 + 2351e01 commit 0e69edd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions SMPageControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,11 @@ - (UIImage *)imageMaskForPage:(NSInteger)pageIndex
return [self _imageForPage:pageIndex type:SMPageControlImageTypeMask];
}

- (void)sizeToFit
- (CGSize)sizeThatFits:(CGSize)size
{
CGRect frame = self.frame;
CGSize size = [self sizeForNumberOfPages:self.numberOfPages];
size.height = MAX(size.height, MIN_HEIGHT);
frame.size = size;
self.frame = frame;
CGSize sizeThatFits = [self sizeForNumberOfPages:self.numberOfPages];
sizeThatFits.height = MAX(sizeThatFits.height, MIN_HEIGHT);
return sizeThatFits;
}

- (void)updatePageNumberForScrollView:(UIScrollView *)scrollView
Expand Down

0 comments on commit 0e69edd

Please sign in to comment.