From 74e8582eb6781bc9a924ada476cae3c14906cf7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82az=CC=87ej=20Biesiada?= Date: Mon, 6 Oct 2014 14:54:17 +0200 Subject: [PATCH 1/2] Fixed NSInteger casts in NSLog statements (removes compiler warnings). --- Example/SMPageControl/SMViewController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/SMPageControl/SMViewController.m b/Example/SMPageControl/SMViewController.m index d61dcbf..4e48aec 100644 --- a/Example/SMPageControl/SMViewController.m +++ b/Example/SMPageControl/SMViewController.m @@ -73,12 +73,12 @@ - (void)viewDidLoad - (void)pageControl:(id)sender { - NSLog(@"Current Page (UIPageControl) : %i", self.pageControl.currentPage); + NSLog(@"Current Page (UIPageControl) : %li", (long)self.pageControl.currentPage); } - (void)spacePageControl:(SMPageControl *)sender { - NSLog(@"Current Page (SMPageControl): %i", sender.currentPage); + NSLog(@"Current Page (SMPageControl): %li", (long)sender.currentPage); } @end From 1e16c223c2428d7394ef579e44c07d67eb76819a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82az=CC=87ej=20Biesiada?= Date: Mon, 6 Oct 2014 15:52:11 +0200 Subject: [PATCH 2/2] Added real width to -intrinsicContentSize return value. --- SMPageControl.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SMPageControl.m b/SMPageControl.m index b0eb1fa..2099125 100755 --- a/SMPageControl.m +++ b/SMPageControl.m @@ -378,9 +378,10 @@ - (CGSize)sizeThatFits:(CGSize)size - (CGSize)intrinsicContentSize { if (_numberOfPages < 1 || (_numberOfPages < 2 && _hidesForSinglePage)) { - return CGSizeMake(UIViewNoIntrinsicMetric, 0.0f); + return CGSizeZero; } - CGSize intrinsicContentSize = CGSizeMake(UIViewNoIntrinsicMetric, MAX(_measuredIndicatorHeight, _minHeight)); + CGFloat intrinsicContentWidth = [self sizeForNumberOfPages:self.numberOfPages].width; + CGSize intrinsicContentSize = CGSizeMake(intrinsicContentWidth, MAX(_measuredIndicatorHeight, _minHeight)); return intrinsicContentSize; }