BDBSpinKitRefreshControl is a drop-in replacement for UIRefreshControl that utilizes the fantastic SpinKit progress indicators.
Adding BDBSpinKitRefreshControl is simple: just instantiate it the way you would a regular UIRefreshControl!
self.refreshControl =
[BDBSpinKitRefreshControl refreshControlWithStyle:RTSpinKitViewStyleBounce color:[UIColor redColor]];
[self.refreshControl addTarget:self
action:@selector(doSomething:)
forControlEvents:UIControlEventValueChanged];
BDBSpinKitRefreshControl supports all of the currently implemented styles in the SpinKit-ObjC project. For full documentation, please take a look at its project page.
In order to mimic as closely as possible the behavior of a standard UIRefreshControl, I've added a shouldChangeColorInstantly
property that defaults to NO. With a standard UIRefreshControl, if you attempt to change the tintColor
property while it is visible, nothing will happen. On the next pull, however, the color change will have taken effect. If you wish to allow changing the color while the refresh control is visible, simply set shouldChangeColorInstantly
to YES when instantiating.
BDBSpinKitRefreshControl was created by Bradley David Bergeron and utilizes SpinKit-ObjC by Ramon Torres.