diff --git a/RefreshControl/Assets/bicon.png b/RefreshControl/Assets/bicon.png new file mode 100755 index 0000000..da38941 Binary files /dev/null and b/RefreshControl/Assets/bicon.png differ diff --git a/RefreshControl/Assets/bicon@2x.png b/RefreshControl/Assets/bicon@2x.png new file mode 100755 index 0000000..b75f651 Binary files /dev/null and b/RefreshControl/Assets/bicon@2x.png differ diff --git a/RefreshControl/Assets/dark_circle.png b/RefreshControl/Assets/dark_circle.png new file mode 100755 index 0000000..a12dcb3 Binary files /dev/null and b/RefreshControl/Assets/dark_circle.png differ diff --git a/RefreshControl/Assets/dark_circle@2x.png b/RefreshControl/Assets/dark_circle@2x.png new file mode 100755 index 0000000..c1b9a91 Binary files /dev/null and b/RefreshControl/Assets/dark_circle@2x.png differ diff --git a/RefreshControl/Assets/light_circle.png b/RefreshControl/Assets/light_circle.png new file mode 100755 index 0000000..598d89f Binary files /dev/null and b/RefreshControl/Assets/light_circle.png differ diff --git a/RefreshControl/Assets/light_circle@2x.png b/RefreshControl/Assets/light_circle@2x.png new file mode 100755 index 0000000..bedb5ce Binary files /dev/null and b/RefreshControl/Assets/light_circle@2x.png differ diff --git a/RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.h b/RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.h new file mode 100644 index 0000000..da84ff4 --- /dev/null +++ b/RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.h @@ -0,0 +1,13 @@ +// +// XHPinterestPullRefreshTableViewController.h +// XHRefreshControlExample +// +// Created by Jack_iMac on 15/8/7. +// Copyright (c) 2015年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. +// + +#import "XHPullRefreshTableViewController.h" + +@interface XHPinterestPullRefreshTableViewController : XHPullRefreshTableViewController + +@end diff --git a/RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.m b/RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.m new file mode 100644 index 0000000..03b5107 --- /dev/null +++ b/RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.m @@ -0,0 +1,74 @@ +// +// XHPinterestPullRefreshTableViewController.m +// XHRefreshControlExample +// +// Created by Jack_iMac on 15/8/7. +// Copyright (c) 2015年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. +// + +#import "XHPinterestPullRefreshTableViewController.h" + +#import "XHPinterestRefreshView.h" + +@interface XHPinterestPullRefreshTableViewController () + +@property (nonatomic, strong) XHPinterestRefreshView *refreshView; + +@end + +@implementation XHPinterestPullRefreshTableViewController + +#pragma mark - Propertys + +- (XHPinterestRefreshView *)refreshView { + if (!_refreshView) { + _refreshView = [[XHPinterestRefreshView alloc] initWithFrame:CGRectMake(0, -50, CGRectGetWidth(self.view.bounds), 50)]; + } + return _refreshView; +} + +#pragma mark - XHRefreshControl Delegate + +- (UIView *)customPullDownRefreshView { + return self.refreshView; +} + +- (void)customPullDownRefreshViewRefreshState:(XHRefreshState)refreshState { + switch (refreshState) { + case XHRefreshStateNormal: + case XHRefreshStateStopped: + [self.refreshView normal]; + break; + case XHRefreshStateLoading: + [self.refreshView refreing]; + break; + case XHRefreshStatePulling: + break; + default: + break; + } +} + +- (void)customPullDownRefreshView:(UIView *)customPullDownRefreshView withPullDownOffset:(CGFloat)pullDownOffset { + self.refreshView.pullDownOffset = pullDownOffset; +} + +- (void)customPullDownRefreshViewWillStartRefresh:(UIView *)customPullDownRefreshView { + [self.refreshView willStartRefreshing]; +} +- (void)customPullDownRefreshViewDidStartRefresh:(UIView *)customPullDownRefreshView { + [self.refreshView didStartRefreshing]; +} + +- (void)customPullDownRefreshViewWillEndRefresh:(UIView *)customPullDownRefreshView { + [self.refreshView willEndRefreshing]; +} +- (void)customPullDownRefreshViewDidEndRefresh:(UIView *)customPullDownRefreshView { + [self.refreshView didEndRefresing]; +} + +- (XHPullDownRefreshViewType)pullDownRefreshViewType { + return XHPullDownRefreshViewTypeCustom; +} + +@end diff --git a/RefreshControl/Manager/XHRefreshControlHeader.h b/RefreshControl/Manager/XHRefreshControlHeader.h index f8ba1f9..4dd59ea 100644 --- a/RefreshControl/Manager/XHRefreshControlHeader.h +++ b/RefreshControl/Manager/XHRefreshControlHeader.h @@ -17,7 +17,8 @@ typedef NS_ENUM(NSInteger, XHRefreshViewLayerType) { typedef NS_ENUM(NSInteger, XHPullDownRefreshViewType) { XHPullDownRefreshViewTypeCircle = 0, XHPullDownRefreshViewTypeActivityIndicator = 1, - XHPullDownRefreshViewTypeCustom = 2, + XHPullDownRefreshViewTypePinterest = 2, + XHPullDownRefreshViewTypeCustom = 3, }; typedef NS_ENUM(NSInteger, XHRefreshState) { diff --git a/RefreshControl/Views/XHActivityIndicatorView.h b/RefreshControl/Views/XHActivityIndicatorView.h new file mode 100755 index 0000000..d343a3d --- /dev/null +++ b/RefreshControl/Views/XHActivityIndicatorView.h @@ -0,0 +1,80 @@ +// +// HZActivityIndicator.h +// HZActivityIndicator +// +// Created by Hezi Cohen on 10/7/11. +// Copyright (c) 2011 Hezi Cohen. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// Neither the name of the project's author nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +#import + +// this code form https://github.com/hezi/HZActivityIndicatorView + +typedef enum HZActivityIndicatorDirection { + HZActivityIndicatorDirectionClockwise = -1, + HZActivityIndicatorDirectionCounterClockwise = 1 +} HZActivityIndicatorDirection; + +@interface XHActivityIndicatorView : UIView { + NSUInteger _steps; + CGFloat _stepDuration; + BOOL _isAnimating; + + UIColor *_color; + BOOL _hidesWhenStopped; + UIRectCorner _roundedCoreners; + CGSize _cornerRadii; + CGSize _finSize; + HZActivityIndicatorDirection _direction; + UIActivityIndicatorViewStyle _actualActivityIndicatorViewStyle; +} + +@property (nonatomic) NSUInteger steps; +@property (nonatomic) NSUInteger indicatorRadius; +@property (nonatomic) CGFloat stepDuration; +@property (nonatomic) CGSize finSize; +@property (nonatomic, strong) UIColor *color; +@property (nonatomic) UIRectCorner roundedCoreners; +@property (nonatomic) CGSize cornerRadii; +@property (nonatomic) HZActivityIndicatorDirection direction; +@property (nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; +@property (nonatomic) CGFloat progress; + +@property(nonatomic) BOOL hidesWhenStopped; + +- (id)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style; + +- (void)startAnimating; +- (void)stopAnimating; +- (BOOL)isAnimating; + +- (UIBezierPath *)finPathWithRect:(CGRect)rect; + +@end diff --git a/RefreshControl/Views/XHActivityIndicatorView.m b/RefreshControl/Views/XHActivityIndicatorView.m new file mode 100755 index 0000000..04d3a38 --- /dev/null +++ b/RefreshControl/Views/XHActivityIndicatorView.m @@ -0,0 +1,242 @@ +// +// HZActivityIndicator.m +// HZActivityIndicator +// +// Created by Hezi Cohen on 10/7/11. +// Copyright (c) 2011 Hezi Cohen. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// Neither the name of the project's author nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +#import "XHActivityIndicatorView.h" + +@interface XHActivityIndicatorView () { + NSTimer *_timer; + CGFloat _anglePerStep; + CGFloat _currStep; +} + +- (void)_repeatAnimation:(NSTimer*)timer; +- (UIColor*)_colorForStep:(NSUInteger)stepIndex; +- (void)_setPropertiesForStyle:(UIActivityIndicatorViewStyle)style; + +@end + +@implementation XHActivityIndicatorView +@synthesize steps = _steps; +@synthesize indicatorRadius = _indicatorRadius; +@synthesize finSize = _finSize; +@synthesize color = _color; +@synthesize stepDuration = _stepDuration; +@synthesize hidesWhenStopped = _hidesWhenStopped; +@synthesize roundedCoreners = _roundedCoreners; +@synthesize cornerRadii = _cornerRadii; +@synthesize direction = _direction; +@synthesize activityIndicatorViewStyle = _actualActivityIndicatorViewStyle; + +- (void)awakeFromNib { + [self _setPropertiesForStyle:UIActivityIndicatorViewStyleWhite]; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) + { + [self _setPropertiesForStyle:UIActivityIndicatorViewStyleWhite]; + } + return self; +} + +- (id)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style { + self = [self initWithFrame:CGRectZero]; + if (self) + { + [self _setPropertiesForStyle:style]; + } + return self; +} + +- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle { + [self _setPropertiesForStyle:activityIndicatorViewStyle]; +} + +- (void)_setPropertiesForStyle:(UIActivityIndicatorViewStyle)style { + self.backgroundColor = [UIColor clearColor]; + self.direction = HZActivityIndicatorDirectionClockwise; + self.roundedCoreners = UIRectCornerAllCorners; + self.cornerRadii = CGSizeMake(1, 1); + self.stepDuration = 0.1; + self.steps = 12; + + switch (style) { + case UIActivityIndicatorViewStyleGray: + { + self.color = [UIColor darkGrayColor]; + self.finSize = CGSizeMake(2, 5); + self.indicatorRadius = 5; + + break; + } + + case UIActivityIndicatorViewStyleWhite: + { + self.color = [UIColor whiteColor]; + self.finSize = CGSizeMake(2, 5); + self.indicatorRadius = 5; + + break; + } + + case UIActivityIndicatorViewStyleWhiteLarge: + { + self.color = [UIColor whiteColor]; + self.cornerRadii = CGSizeMake(2, 2); + self.finSize = CGSizeMake(3, 9); + self.indicatorRadius = 8.5; + + break; + } + + default: + [NSException raise:NSInvalidArgumentException format:@"style invalid"]; + break; + } + + _isAnimating = NO; + if (_hidesWhenStopped) + self.hidden = YES; +} + +#pragma mark - UIActivityIndicator + +- (void)startAnimating { + if(self.isAnimating) + return; + + // maa bugfix: this was 0 in the original code. this means clockwise rotation starts more slowly than it should. + _currStep = self.direction == HZActivityIndicatorDirectionClockwise ? self.steps - 1 : 0; + _timer = [NSTimer scheduledTimerWithTimeInterval:_stepDuration target:self selector:@selector(_repeatAnimation:) userInfo:nil repeats:YES]; + [[NSRunLoop mainRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; + _isAnimating = YES; + + if (_hidesWhenStopped) + self.hidden = NO; +} + +- (void)stopAnimating { + if (_timer) + { + [_timer invalidate]; + _timer = nil; + } + _currStep = self.direction == HZActivityIndicatorDirectionClockwise ? self.steps - 1 : 0; + [self setNeedsDisplay]; + + _isAnimating = NO; + if (_hidesWhenStopped) + self.hidden = YES; +} + +- (BOOL)isAnimating { + return _isAnimating; +} + +#pragma mark - HZActivityIndicator Drawing. + +- (void)setIndicatorRadius:(NSUInteger)indicatorRadius { + _indicatorRadius = indicatorRadius; + self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, + _indicatorRadius*2 + _finSize.height*2, + _indicatorRadius*2 + _finSize.height*2); + [self setNeedsDisplay]; +} + +- (void)setSteps:(NSUInteger)steps { + _anglePerStep = (360.0 / (CGFloat)steps) * M_PI / 180.0; + _steps = steps; + [self setNeedsDisplay]; +} + +- (void)setFinSize:(CGSize)finSize { + _finSize = finSize; + [self setNeedsDisplay]; +} + +- (void)setProgress:(CGFloat)progress { + _progress = progress; + [self setNeedsDisplay]; +} + +- (UIColor*)_colorForStep:(NSUInteger)stepIndex { + CGFloat alpha = 1.0 - (stepIndex % _steps) * (1.0 / _steps); + CGColorRef copiedColor = CGColorCreateCopyWithAlpha(_color.CGColor, alpha); + UIColor *color = [UIColor colorWithCGColor:copiedColor]; + CGColorRelease(copiedColor); + return color; +} + +- (void)_repeatAnimation:(NSTimer*)timer { + _currStep ++; + [self setNeedsDisplay]; +} + +- (UIBezierPath *)finPathWithRect:(CGRect)rect { + return [UIBezierPath bezierPathWithRoundedRect:rect + byRoundingCorners:_roundedCoreners + cornerRadii:_cornerRadii]; +} + +- (void)drawRect:(CGRect)rect { + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGRect finRect = CGRectMake(self.bounds.size.width/2 - _finSize.width/2, 0, + _finSize.width, _finSize.height); + UIBezierPath *bezierPath = [self finPathWithRect:finRect]; + + CGPathRef bezierPathRef = CGPathCreateCopy([bezierPath CGPath]); + + for (int i = 0; i < _steps; i++) + { + if (!_isAnimating && _progress < ((CGFloat)(i + 1) / (CGFloat)(_steps))) break; + [[self _colorForStep:_currStep+i*_direction] set]; + + CGContextBeginPath(context); + CGContextAddPath(context, bezierPathRef); + CGContextClosePath(context); + CGContextFillPath(context); + + CGContextTranslateCTM(context, self.bounds.size.width / 2, self.bounds.size.height / 2); + CGContextRotateCTM(context, _anglePerStep); + CGContextTranslateCTM(context, -(self.bounds.size.width / 2), -(self.bounds.size.height / 2)); + } + + CGPathRelease(bezierPathRef); +} + + +@end diff --git a/RefreshControl/Views/XHCircularProgressView.h b/RefreshControl/Views/XHCircularProgressView.h new file mode 100755 index 0000000..af31ea1 --- /dev/null +++ b/RefreshControl/Views/XHCircularProgressView.h @@ -0,0 +1,22 @@ +// +// BMYCircularProgressView.h +// BMYPullToRefreshDemo +// +// Created by Alberto De Bortoli on 15/05/2014. +// Copyright (c) 2014 Beamly. All rights reserved. +// + +#import + +// this code from https://github.com/beamly/BMYCircularProgressPullToRefresh + +@interface XHCircularProgressView : UIView + +@property (nonatomic, assign) CGFloat progress; + +- (id)initWithFrame:(CGRect)frame + logo:(UIImage *)logoImage + backCircleImage:(UIImage *)backCircleImage + frontCircleImage:(UIImage *)frontCircleImage; + +@end diff --git a/RefreshControl/Views/XHCircularProgressView.m b/RefreshControl/Views/XHCircularProgressView.m new file mode 100755 index 0000000..7c3f714 --- /dev/null +++ b/RefreshControl/Views/XHCircularProgressView.m @@ -0,0 +1,89 @@ +// +// BMYCircularProgressView.m +// BMYPullToRefreshDemo +// +// Created by Alberto De Bortoli on 15/05/2014. +// Copyright (c) 2014 Beamly. All rights reserved. +// + +#import "XHCircularProgressView.h" + +#import + +#define degToRad(angle) (angle) * (M_PI / 180.0) + +@interface XHCircularProgressView () + +@property (nonatomic, strong) CAShapeLayer *logoLayer; +@property (nonatomic, strong) CAShapeLayer *backCircleLayer; +@property (nonatomic, strong) CAShapeLayer *frontCircleLayer; +@property (nonatomic, strong) CAShapeLayer *pieLayer; + +@end + +@implementation XHCircularProgressView + +- (id)initWithFrame:(CGRect)frame + logo:(UIImage *)logoImage + backCircleImage:(UIImage *)backCircleImage + frontCircleImage:(UIImage *)frontCircleImage { + self = [super initWithFrame:frame]; + if (self) { + _logoLayer = [CAShapeLayer layer]; + _backCircleLayer = [CAShapeLayer layer]; + _frontCircleLayer = [CAShapeLayer layer]; + _pieLayer = [CAShapeLayer layer]; + + [self.layer addSublayer:_logoLayer]; + [self.layer addSublayer:_backCircleLayer]; + [self.layer addSublayer:_frontCircleLayer]; + [self.layer addSublayer:_pieLayer]; + + _logoLayer.contents = (__bridge id)[logoImage CGImage]; + _backCircleLayer.contents = (__bridge id)[backCircleImage CGImage]; + _frontCircleLayer.contents = (__bridge id)[frontCircleImage CGImage]; + _frontCircleLayer.mask = _pieLayer; + _logoLayer.opacity = 0.0f; + } + return self; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + _logoLayer.frame = self.bounds; + _backCircleLayer.frame = self.bounds; + _frontCircleLayer.frame = self.bounds; + _pieLayer.frame = self.bounds; +} + +#pragma mark - BMYProgressViewProtocol + +- (void)setProgress:(CGFloat)progress { + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + + [self updatePie:_pieLayer forAngle:progress * 360.0f]; + _frontCircleLayer.mask = _pieLayer; + _logoLayer.opacity = progress; + + [CATransaction commit]; +} + +#pragma mark - Private Methods + +- (void)updatePie:(CAShapeLayer *)layer forAngle:(CGFloat)degrees { + CGFloat angle = degToRad(-90); + CGPoint center_ = CGPointMake(CGRectGetWidth(layer.frame)/2.0, CGRectGetWidth(layer.frame)/2.0); + CGFloat radius = CGRectGetWidth(layer.frame)/2.0; + + UIBezierPath *piePath = [UIBezierPath bezierPath]; + [piePath moveToPoint:center_]; + [piePath addLineToPoint:CGPointMake(center_.x, center_.y - radius)]; + [piePath addArcWithCenter:center_ radius:radius startAngle:angle endAngle:degToRad(degrees - 90.0f) clockwise:YES]; + [piePath addLineToPoint:center_]; + [piePath closePath]; + + layer.path = piePath.CGPath; +} + +@end diff --git a/RefreshControl/Views/XHPinterestRefreshView.h b/RefreshControl/Views/XHPinterestRefreshView.h new file mode 100644 index 0000000..e6b6aa9 --- /dev/null +++ b/RefreshControl/Views/XHPinterestRefreshView.h @@ -0,0 +1,25 @@ +// +// XHPinterestRefreshView.h +// XHRefreshControlExample +// +// Created by Jack_iMac on 15/8/7. +// Copyright (c) 2015年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. +// + +#import + +@interface XHPinterestRefreshView : UIView + +@property (nonatomic, assign) CGFloat pullDownOffset; + +- (void)willStartRefreshing; +- (void)didStartRefreshing; + +- (void)refreing; + +- (void)willEndRefreshing; +- (void)didEndRefresing; + +- (void)normal; + +@end diff --git a/RefreshControl/Views/XHPinterestRefreshView.m b/RefreshControl/Views/XHPinterestRefreshView.m new file mode 100644 index 0000000..cbb388b --- /dev/null +++ b/RefreshControl/Views/XHPinterestRefreshView.m @@ -0,0 +1,96 @@ +// +// XHPinterestRefreshView.m +// XHRefreshControlExample +// +// Created by Jack_iMac on 15/8/7. +// Copyright (c) 2015年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. +// + +#import "XHPinterestRefreshView.h" + +#import "XHActivityIndicatorView.h" +#import "XHCircularProgressView.h" + +@interface XHPinterestRefreshView () + +@property (nonatomic, strong) XHActivityIndicatorView *activityIndicatorView; +@property (nonatomic, strong) XHCircularProgressView *circularProgressView; + +@end + +@implementation XHPinterestRefreshView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self addSubview:self.activityIndicatorView]; + [self addSubview:self.circularProgressView]; + } + return self; +} + +- (void)willStartRefreshing { + [self.activityIndicatorView startAnimating]; + [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + self.circularProgressView.alpha = 0.0; + } completion:^(BOOL finished) { + }]; +} +- (void)didStartRefreshing { +} + +- (void)normal { +} +- (void)refreing { +} + +- (void)willEndRefreshing { + [self.activityIndicatorView stopAnimating]; + [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + self.circularProgressView.alpha = 1.0; + + } completion:^(BOOL finished) { + }]; +} +- (void)didEndRefresing { +} + +#pragma mark - Propertys + +- (void)setPullDownOffset:(CGFloat)pullDownOffset { + if (_pullDownOffset == pullDownOffset) { + return ; + } + _pullDownOffset = pullDownOffset; + + CGFloat progress = pullDownOffset / 40.0; + self.circularProgressView.progress = progress; +} + +- (XHActivityIndicatorView *)activityIndicatorView { + if (!_activityIndicatorView) { + _activityIndicatorView = [[XHActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; + _activityIndicatorView.hidesWhenStopped = YES; + _activityIndicatorView.color = [UIColor redColor]; + _activityIndicatorView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); + } + return _activityIndicatorView; +} + +- (XHCircularProgressView *)circularProgressView { + if (!_circularProgressView) { + UIImage *logoImage = [UIImage imageNamed:@"bicon.png"]; + UIImage *backCircleImage = [UIImage imageNamed:@"light_circle.png"]; + UIImage *frontCircleImage = [UIImage imageNamed:@"dark_circle.png"]; + + _circularProgressView = [[XHCircularProgressView alloc] initWithFrame:CGRectMake(0, 0, 25, 25) + logo:logoImage + backCircleImage:backCircleImage + frontCircleImage:frontCircleImage]; + + _circularProgressView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); + } + return _circularProgressView; +} + +@end diff --git a/XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.pbxproj b/XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.pbxproj index 7cb362b..eaec6e9 100644 --- a/XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.pbxproj +++ b/XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.pbxproj @@ -53,6 +53,17 @@ E453904C1AE7F7900077DF19 /* staticDeliveryStaff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E45390461AE7F7900077DF19 /* staticDeliveryStaff@2x.png */; }; E45390501AE7F8340077DF19 /* XHJDRefreshDemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E453904F1AE7F8340077DF19 /* XHJDRefreshDemoTableViewController.m */; }; E4E0DCD81AE144F700B23B93 /* nothing_more_tips@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E4E0DCD71AE144F700B23B93 /* nothing_more_tips@2x.png */; }; + E4ECA1B61B74E5510028E6E4 /* XHCircularProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = E4ECA1B51B74E5510028E6E4 /* XHCircularProgressView.m */; }; + E4ECA1B91B74E74E0028E6E4 /* XHActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = E4ECA1B81B74E74E0028E6E4 /* XHActivityIndicatorView.m */; }; + E4ECA1BC1B74E86F0028E6E4 /* XHPinterestRefreshView.m in Sources */ = {isa = PBXBuildFile; fileRef = E4ECA1BB1B74E86F0028E6E4 /* XHPinterestRefreshView.m */; }; + E4ECA1BF1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4ECA1BE1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.m */; }; + E4ECA1C61B74EA2F0028E6E4 /* bicon.png in Resources */ = {isa = PBXBuildFile; fileRef = E4ECA1C01B74EA2F0028E6E4 /* bicon.png */; }; + E4ECA1C71B74EA2F0028E6E4 /* bicon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E4ECA1C11B74EA2F0028E6E4 /* bicon@2x.png */; }; + E4ECA1C81B74EA2F0028E6E4 /* dark_circle.png in Resources */ = {isa = PBXBuildFile; fileRef = E4ECA1C21B74EA2F0028E6E4 /* dark_circle.png */; }; + E4ECA1C91B74EA2F0028E6E4 /* dark_circle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E4ECA1C31B74EA2F0028E6E4 /* dark_circle@2x.png */; }; + E4ECA1CA1B74EA2F0028E6E4 /* light_circle.png in Resources */ = {isa = PBXBuildFile; fileRef = E4ECA1C41B74EA2F0028E6E4 /* light_circle.png */; }; + E4ECA1CB1B74EA2F0028E6E4 /* light_circle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E4ECA1C51B74EA2F0028E6E4 /* light_circle@2x.png */; }; + E4ECA1CF1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4ECA1CE1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.m */; }; F7CDBF4E1A5BCB8300DE641D /* XHSimulationNetEaseNetworkErrorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7CDBF4D1A5BCB8300DE641D /* XHSimulationNetEaseNetworkErrorViewController.m */; }; /* End PBXBuildFile section */ @@ -143,6 +154,22 @@ E453904E1AE7F8340077DF19 /* XHJDRefreshDemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHJDRefreshDemoTableViewController.h; sourceTree = ""; }; E453904F1AE7F8340077DF19 /* XHJDRefreshDemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHJDRefreshDemoTableViewController.m; sourceTree = ""; }; E4E0DCD71AE144F700B23B93 /* nothing_more_tips@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "nothing_more_tips@2x.png"; sourceTree = ""; }; + E4ECA1B41B74E5510028E6E4 /* XHCircularProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHCircularProgressView.h; sourceTree = ""; }; + E4ECA1B51B74E5510028E6E4 /* XHCircularProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHCircularProgressView.m; sourceTree = ""; }; + E4ECA1B71B74E74E0028E6E4 /* XHActivityIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHActivityIndicatorView.h; sourceTree = ""; }; + E4ECA1B81B74E74E0028E6E4 /* XHActivityIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHActivityIndicatorView.m; sourceTree = ""; }; + E4ECA1BA1B74E86F0028E6E4 /* XHPinterestRefreshView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHPinterestRefreshView.h; sourceTree = ""; }; + E4ECA1BB1B74E86F0028E6E4 /* XHPinterestRefreshView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHPinterestRefreshView.m; sourceTree = ""; }; + E4ECA1BD1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHPinterestPullRefreshTableViewController.h; sourceTree = ""; }; + E4ECA1BE1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHPinterestPullRefreshTableViewController.m; sourceTree = ""; }; + E4ECA1C01B74EA2F0028E6E4 /* bicon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bicon.png; sourceTree = ""; }; + E4ECA1C11B74EA2F0028E6E4 /* bicon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bicon@2x.png"; sourceTree = ""; }; + E4ECA1C21B74EA2F0028E6E4 /* dark_circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dark_circle.png; sourceTree = ""; }; + E4ECA1C31B74EA2F0028E6E4 /* dark_circle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dark_circle@2x.png"; sourceTree = ""; }; + E4ECA1C41B74EA2F0028E6E4 /* light_circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = light_circle.png; sourceTree = ""; }; + E4ECA1C51B74EA2F0028E6E4 /* light_circle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "light_circle@2x.png"; sourceTree = ""; }; + E4ECA1CD1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PinterestDemoRefreshTableViewController.h; sourceTree = ""; }; + E4ECA1CE1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PinterestDemoRefreshTableViewController.m; sourceTree = ""; }; F7CDBF4C1A5BCB8300DE641D /* XHSimulationNetEaseNetworkErrorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHSimulationNetEaseNetworkErrorViewController.h; sourceTree = ""; }; F7CDBF4D1A5BCB8300DE641D /* XHSimulationNetEaseNetworkErrorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHSimulationNetEaseNetworkErrorViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -312,6 +339,8 @@ AB94836919721DE0001BC1FD /* XHPullRefreshTableViewController.m */, E453903A1AE7F1BC0077DF19 /* XHJDPullRefreshTableViewController.h */, E453903B1AE7F1BC0077DF19 /* XHJDPullRefreshTableViewController.m */, + E4ECA1BD1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.h */, + E4ECA1BE1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.m */, ); path = CustomTableViewController; sourceTree = ""; @@ -352,6 +381,12 @@ AB94837F19721DE0001BC1FD /* XHRefreshCircleContainerView.m */, E453903D1AE7F33D0077DF19 /* XHJDRefreshView.h */, E453903E1AE7F33D0077DF19 /* XHJDRefreshView.m */, + E4ECA1BA1B74E86F0028E6E4 /* XHPinterestRefreshView.h */, + E4ECA1BB1B74E86F0028E6E4 /* XHPinterestRefreshView.m */, + E4ECA1B41B74E5510028E6E4 /* XHCircularProgressView.h */, + E4ECA1B51B74E5510028E6E4 /* XHCircularProgressView.m */, + E4ECA1B71B74E74E0028E6E4 /* XHActivityIndicatorView.h */, + E4ECA1B81B74E74E0028E6E4 /* XHActivityIndicatorView.m */, ); path = Views; sourceTree = ""; @@ -360,6 +395,7 @@ isa = PBXGroup; children = ( AB94839819721E8D001BC1FD /* Root */, + E4ECA1CC1B74EBB50028E6E4 /* PinterestDemoRefreshTableViewController */, E453904D1AE7F8240077DF19 /* JDRefreshDemoTableViewController */, AB94839519721E8D001BC1FD /* DemoTableViewController */, AB94838F19721E8D001BC1FD /* CustomLoadMoreButtonDemoTableViewController */, @@ -428,6 +464,12 @@ E45390401AE7F7900077DF19 /* Assets */ = { isa = PBXGroup; children = ( + E4ECA1C01B74EA2F0028E6E4 /* bicon.png */, + E4ECA1C11B74EA2F0028E6E4 /* bicon@2x.png */, + E4ECA1C21B74EA2F0028E6E4 /* dark_circle.png */, + E4ECA1C31B74EA2F0028E6E4 /* dark_circle@2x.png */, + E4ECA1C41B74EA2F0028E6E4 /* light_circle.png */, + E4ECA1C51B74EA2F0028E6E4 /* light_circle@2x.png */, E45390411AE7F7900077DF19 /* box@2x.png */, E45390421AE7F7900077DF19 /* deliveryStaff0@2x.png */, E45390431AE7F7900077DF19 /* deliveryStaff1@2x.png */, @@ -447,6 +489,15 @@ path = JDRefreshDemoTableViewController; sourceTree = ""; }; + E4ECA1CC1B74EBB50028E6E4 /* PinterestDemoRefreshTableViewController */ = { + isa = PBXGroup; + children = ( + E4ECA1CD1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.h */, + E4ECA1CE1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.m */, + ); + path = PinterestDemoRefreshTableViewController; + sourceTree = ""; + }; F7CDBF4B1A5BCB7300DE641D /* SimulationNetEaseNetworkErrorViewController */ = { isa = PBXGroup; children = ( @@ -536,13 +587,19 @@ E453904B1AE7F7900077DF19 /* deliveryStaff3@2x.png in Resources */, 7D093BAD1963FE1100F563BD /* NSDateTimeAgo.bundle in Resources */, E453904A1AE7F7900077DF19 /* deliveryStaff2@2x.png in Resources */, + E4ECA1C71B74EA2F0028E6E4 /* bicon@2x.png in Resources */, E45390481AE7F7900077DF19 /* deliveryStaff0@2x.png in Resources */, + E4ECA1CA1B74EA2F0028E6E4 /* light_circle.png in Resources */, E45390491AE7F7900077DF19 /* deliveryStaff1@2x.png in Resources */, E453904C1AE7F7900077DF19 /* staticDeliveryStaff@2x.png in Resources */, AB0B346B19429D4700EC0072 /* Images.xcassets in Resources */, AB0B345A19429D4700EC0072 /* InfoPlist.strings in Resources */, E45390471AE7F7900077DF19 /* box@2x.png in Resources */, + E4ECA1C81B74EA2F0028E6E4 /* dark_circle.png in Resources */, E4E0DCD81AE144F700B23B93 /* nothing_more_tips@2x.png in Resources */, + E4ECA1CB1B74EA2F0028E6E4 /* light_circle@2x.png in Resources */, + E4ECA1C61B74EA2F0028E6E4 /* bicon.png in Resources */, + E4ECA1C91B74EA2F0028E6E4 /* dark_circle@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -568,6 +625,7 @@ AB94838619721DE0001BC1FD /* XHSysatemRefreshTableViewController.m in Sources */, AB94838719721DE0001BC1FD /* XHSystemTableViewController.m in Sources */, 7D6DF80919C8704100405BCB /* XHSystemRefreshCollectionViewController.m in Sources */, + E4ECA1B61B74E5510028E6E4 /* XHCircularProgressView.m in Sources */, E453903C1AE7F1BC0077DF19 /* XHJDPullRefreshTableViewController.m in Sources */, AB94838A19721DE0001BC1FD /* XHCircleView.m in Sources */, 7D093BAC1963FE1100F563BD /* NSDate+TimeAgo.m in Sources */, @@ -575,12 +633,15 @@ AB94838819721DE0001BC1FD /* XHRefreshControl.m in Sources */, 7DEF9CFB19EFD04600E6996E /* CollectionViewFlowLayout.m in Sources */, AB9483A219721E8D001BC1FD /* XHDemoSystemTableViewController.m in Sources */, + E4ECA1B91B74E74E0028E6E4 /* XHActivityIndicatorView.m in Sources */, AB9483A319721E8D001BC1FD /* XHDemoTableViewController.m in Sources */, AB94838019721DE0001BC1FD /* XHBaseTableViewController.m in Sources */, + E4ECA1BC1B74E86F0028E6E4 /* XHPinterestRefreshView.m in Sources */, AB94838319721DE0001BC1FD /* XHFoundationCommon.m in Sources */, AB94838D19721DE0001BC1FD /* XHRefreshCircleContainerView.m in Sources */, AB9483A619721E8D001BC1FD /* XHSegueItem.m in Sources */, AB94838919721DE0001BC1FD /* XHActivityCircleIndicatorView.m in Sources */, + E4ECA1BF1B74E9280028E6E4 /* XHPinterestPullRefreshTableViewController.m in Sources */, F7CDBF4E1A5BCB8300DE641D /* XHSimulationNetEaseNetworkErrorViewController.m in Sources */, AB9483A419721E8D001BC1FD /* XHRootTableViewController.m in Sources */, AB94838419721DE0001BC1FD /* XHPullRefreshTableViewController.m in Sources */, @@ -589,6 +650,7 @@ AB9483A119721E8D001BC1FD /* XHCustomLoadMoreButtonDemoTableViewController.m in Sources */, E453903F1AE7F33D0077DF19 /* XHJDRefreshView.m in Sources */, AB0B345C19429D4700EC0072 /* main.m in Sources */, + E4ECA1CF1B74EBC00028E6E4 /* PinterestDemoRefreshTableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.h b/XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.h new file mode 100644 index 0000000..ae7d110 --- /dev/null +++ b/XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.h @@ -0,0 +1,13 @@ +// +// PinterestDemoRefreshTableViewController.h +// XHRefreshControlExample +// +// Created by Jack_iMac on 15/8/7. +// Copyright (c) 2015年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. +// + +#import "XHPinterestPullRefreshTableViewController.h" + +@interface PinterestDemoRefreshTableViewController : XHPinterestPullRefreshTableViewController + +@end diff --git a/XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.m b/XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.m new file mode 100644 index 0000000..9e8436b --- /dev/null +++ b/XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.m @@ -0,0 +1,87 @@ +// +// PinterestDemoRefreshTableViewController.m +// XHRefreshControlExample +// +// Created by Jack_iMac on 15/8/7. +// Copyright (c) 2015年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. +// + +#import "PinterestDemoRefreshTableViewController.h" + +@implementation PinterestDemoRefreshTableViewController + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [self startPullDownRefreshing]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)dealloc { + +} + +- (void)loadDataSource { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + NSMutableArray *dataSource = [[NSMutableArray alloc] init]; + for (int i = 0; i < 100; i ++) { + [dataSource addObject:@"请问你现在在哪里啊?我在广州天河"]; + } + + NSMutableArray *indexPaths; + if (self.requestCurrentPage) { + indexPaths = [[NSMutableArray alloc] initWithCapacity:dataSource.count]; + [dataSource enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [indexPaths addObject:[NSIndexPath indexPathForRow:self.dataSource.count + idx inSection:0]]; + }]; + } + sleep(4); + dispatch_async(dispatch_get_main_queue(), ^{ + if (self.requestCurrentPage) { + if (self.requestCurrentPage == arc4random() % 10) { + [self endMoreOverWithMessage:@"段子已加载完"]; + } else { + + [self.dataSource addObjectsFromArray:dataSource]; + [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; + [self endLoadMoreRefreshing]; + } + } else { + if (rand() % 3 > 1) { + self.loadMoreRefreshed = NO; + } + + self.dataSource = dataSource; + [self.tableView reloadData]; + [self endPullDownRefreshing]; + } + }); + }); +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *cellIdentifier = @"cellIdentifier"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; + cell.backgroundColor = [UIColor whiteColor]; + cell.contentView.backgroundColor = [UIColor whiteColor]; + cell.backgroundColor = [UIColor whiteColor]; + cell.textLabel.font = [UIFont systemFontOfSize:15]; + } + if (indexPath.row < self.dataSource.count) { + cell.textLabel.text = self.dataSource[indexPath.row]; + } + + return cell; +} + +@end diff --git a/XHRefreshControlExample/XHRefreshControlExample/Controllers/Root/XHRootTableViewController.m b/XHRefreshControlExample/XHRefreshControlExample/Controllers/Root/XHRootTableViewController.m index 7cbf734..23bc960 100644 --- a/XHRefreshControlExample/XHRefreshControlExample/Controllers/Root/XHRootTableViewController.m +++ b/XHRefreshControlExample/XHRefreshControlExample/Controllers/Root/XHRootTableViewController.m @@ -37,6 +37,8 @@ - (void)viewDidLoad self.dataSource = [[NSMutableArray alloc] initWithObjects: [XHSegueItem initSegueItemWithTitle:@"京东原版下拉刷新" onClasseName:@"XHJDRefreshDemoTableViewController"], + [XHSegueItem initSegueItemWithTitle:@"Pinterest" onClasseName:@"PinterestDemoRefreshTableViewController"], + [XHSegueItem initSegueItemWithTitle:@"网易新闻样式有导航栏的" onClasseName:@"XHDemoTableViewController"], [XHSegueItem initSegueItemWithTitle:@"网易新闻样式没有导航栏的" onClasseName:@"XHDemoTableViewController"],