SVPullToRefresh alternatives and similar libraries
Based on the "Pull to Refresh" category.
Alternatively, view SVPullToRefresh alternatives based on common mentions on social networks and blogs.
-
CBStoreHouseRefreshControl
Fully customizable pull-to-refresh control inspired by Storehouse iOS app -
DGElasticPullToRefresh
Elastic pull to refresh for iOS developed in Swift -
BreakOutToRefresh
Play BreakOut while loading - A playable pull to refresh view using SpriteKit -
PullToMakeSoup
Custom animated pull-to-refresh that can be easily added to UIScrollView -
PullToBounce
Animated "Pull To Refresh" Library for UIScrollView. Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh -
ESPullToRefresh
#Busy Re-Building....# An easy way to use pull to refresh and infinite scrolling in Swift. Pod 'ESPullToRefresh' -
UzysAnimatedGifPullToRefresh
Add PullToRefresh using animated GIF to any scrollView with just simple code -
KafkaRefresh
Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development. -
BOZPongRefreshControl
A pull-down-to-refresh control for iOS that plays pong, originally created for the MHacks III iOS app -
mntpulltoreact
One gesture, many actions. An evolution of Pull to Refresh. -
RainyRefreshControl
Simple refresh control for iOS based on SpriteKit and Core Graphics -
PullToRefreshSwift
iOS Simple Cool PullToRefresh Library. It is written in pure swift. -
PullToRefreshCoreText
PullToRefresh extension for all UIScrollView type classes with animated text drawing style -
GIFRefreshControl
GIFRefreshControl is a pull to refresh that supports GIF images as track animations. -
HTPullToRefresh
Easily add vertical and horizontal pull to refresh to any UIScrollView. Can also add multiple pull-to-refesh views at once. -
SurfingRefreshControl
Customizable pull-to-refresh control,written in pure Swift.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SVPullToRefresh or a related project?
README
SVPullToRefresh + SVInfiniteScrolling
These UIScrollView categories makes it super easy to add pull-to-refresh and infinite scrolling fonctionalities to any UIScrollView (or any of its subclass). Instead of relying on delegates and/or subclassing UIViewController
, SVPullToRefresh uses the Objective-C runtime to add the following 3 methods to UIScrollView
:
- (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler;
- (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler position:(SVPullToRefreshPosition)position;
- (void)addInfiniteScrollingWithActionHandler:(void (^)(void))actionHandler;
Installation
From CocoaPods
Add pod 'SVPullToRefresh'
to your Podfile or pod 'SVPullToRefresh', :head
if you're feeling adventurous.
Manually
Important note if your project doesn't use ARC: you must add the -fobjc-arc
compiler flag to UIScrollView+SVPullToRefresh.m
and UIScrollView+SVInfiniteScrolling.m
in Target Settings > Build Phases > Compile Sources.
- Drag the
SVPullToRefresh/SVPullToRefresh
folder into your project. - Add the QuartzCore framework to your project.
- Import
UIScrollView+SVPullToRefresh.h
and/orUIScrollView+SVInfiniteScrolling.h
Usage
(see sample Xcode project in /Demo
)
Adding Pull to Refresh
[tableView addPullToRefreshWithActionHandler:^{
// prepend data to dataSource, insert cells at top of table view
// call [tableView.pullToRefreshView stopAnimating] when done
}];
or if you want pull to refresh from the bottom
[tableView addPullToRefreshWithActionHandler:^{
// prepend data to dataSource, insert cells at top of table view
// call [tableView.pullToRefreshView stopAnimating] when done
} position:SVPullToRefreshPositionBottom];
If you’d like to programmatically trigger the refresh (for instance in viewDidAppear:
), you can do so with:
[tableView triggerPullToRefresh];
You can temporarily hide the pull to refresh view by setting the showsPullToRefresh
property:
tableView.showsPullToRefresh = NO;
Customization
The pull to refresh view can be customized using the following properties/methods:
@property (nonatomic, strong) UIColor *arrowColor;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
- (void)setTitle:(NSString *)title forState:(SVPullToRefreshState)state;
- (void)setSubtitle:(NSString *)subtitle forState:(SVPullToRefreshState)state;
- (void)setCustomView:(UIView *)view forState:(SVPullToRefreshState)state;
You can access these properties through your scroll view's pullToRefreshView
property.
For instance, you would set the arrowColor
property using:
tableView.pullToRefreshView.arrowColor = [UIColor whiteColor];
Adding Infinite Scrolling
[tableView addInfiniteScrollingWithActionHandler:^{
// append data to data source, insert new cells at the end of table view
// call [tableView.infiniteScrollingView stopAnimating] when done
}];
If you’d like to programmatically trigger the loading (for instance in viewDidAppear:
), you can do so with:
[tableView triggerInfiniteScrolling];
You can temporarily hide the infinite scrolling view by setting the showsInfiniteScrolling
property:
tableView.showsInfiniteScrolling = NO;
Customization
The infinite scrolling view can be customized using the following methods:
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle;
- (void)setCustomView:(UIView *)view forState:(SVInfiniteScrollingState)state;
You can access these properties through your scroll view's infiniteScrollingView
property.
Under the hood
SVPullToRefresh extends UIScrollView
by adding new public methods as well as a dynamic properties.
It uses key-value observing to track the scrollView's contentOffset
.
Credits
SVPullToRefresh is brought to you by Sam Vermette and contributors to the project. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by creating new issues. If you're using SVPullToRefresh in your project, attribution would be nice.
Big thanks to @seb_morel for his Demistifying the Objective-C runtime talk which really helped for this project.
Hat tip to Loren Brichter for inventing pull-to-refresh.