From 47e6bd13fa4c0d0242bd3f8f17781544a3b8a0d1 Mon Sep 17 00:00:00 2001 From: Wasupol Tungsakultong Date: Thu, 28 Apr 2016 13:31:02 +0700 Subject: [PATCH 1/3] update enum for swift --- SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h b/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h index 7ce16501..f26d3fcd 100644 --- a/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h +++ b/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h @@ -22,15 +22,13 @@ @end -enum { +typedef NS_ENUM(NSUInteger, SVInfiniteScrollingState) { SVInfiniteScrollingStateStopped = 0, SVInfiniteScrollingStateTriggered, SVInfiniteScrollingStateLoading, SVInfiniteScrollingStateAll = 10 }; -typedef NSUInteger SVInfiniteScrollingState; - @interface SVInfiniteScrollingView : UIView @property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle; From 262c5d29d92c855656b08ac314f7e68fe894df85 Mon Sep 17 00:00:00 2001 From: Wasupol Tungsakultong Date: Sat, 30 Apr 2016 19:21:37 +0700 Subject: [PATCH 2/3] remove dt core add action picker --- SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m b/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m index e43490ec..ac76c5f8 100644 --- a/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m +++ b/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m @@ -294,6 +294,8 @@ - (void)setState:(SVInfiniteScrollingState)newState { case SVInfiniteScrollingStateLoading: [self.activityIndicatorView startAnimating]; break; + default: + break; } } From 3a503920b59ebe2ddda3f652ab3aeb28ad3d0e04 Mon Sep 17 00:00:00 2001 From: wasupol Date: Fri, 16 Sep 2016 16:56:37 +0700 Subject: [PATCH 3/3] update for ios 8 or later --- SVPullToRefresh/UIScrollView+SVPullToRefresh.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/SVPullToRefresh/UIScrollView+SVPullToRefresh.m b/SVPullToRefresh/UIScrollView+SVPullToRefresh.m index ba19078c..6073f321 100644 --- a/SVPullToRefresh/UIScrollView+SVPullToRefresh.m +++ b/SVPullToRefresh/UIScrollView+SVPullToRefresh.m @@ -281,14 +281,15 @@ - (void)layoutSubviews { self.subtitleLabel.text = subtitle.length > 0 ? subtitle : nil; - CGSize titleSize = [self.titleLabel.text sizeWithFont:self.titleLabel.font - constrainedToSize:CGSizeMake(labelMaxWidth,self.titleLabel.font.lineHeight) - lineBreakMode:self.titleLabel.lineBreakMode]; + CGSize titleSize = [self.titleLabel.text boundingRectWithSize:CGSizeMake(labelMaxWidth, self.titleLabel.font.lineHeight) + options:NSStringDrawingUsesLineFragmentOrigin + attributes:nil + context:nil].size; - - CGSize subtitleSize = [self.subtitleLabel.text sizeWithFont:self.subtitleLabel.font - constrainedToSize:CGSizeMake(labelMaxWidth,self.subtitleLabel.font.lineHeight) - lineBreakMode:self.subtitleLabel.lineBreakMode]; + CGSize subtitleSize = [self.subtitleLabel.text boundingRectWithSize:CGSizeMake(labelMaxWidth, self.subtitleLabel.font.lineHeight) + options:NSStringDrawingUsesLineFragmentOrigin + attributes:nil + context:nil].size; CGFloat maxLabelWidth = MAX(titleSize.width,subtitleSize.width);