Adding the ‘pull down to refresh’ effect to UITableView
Today I was tooling around with some interface concepts and playing with apps like foursquare and Twitter (previously Tweetie) and I wondered if I could implement something similar to the now famous 'pull down to refresh' method of initialising a refresh of the content within a UITableView.
As it turns out it wasn't as difficult as I thought; There were already a couple of elegant solutions out and about. The first example I found was by Oliver Dropnik, which talked about altering an existing solution posted on git hub by user devindoty called EGOTablePullViewRefresh.
Oliver's code looked like it was a good addition to devindoty's because he had decided to subclass UITableViewController which leads to a much more complete solution that's easier to move between projects. My only issue with Oliver's code was that it refactored a lot of the underlying implementation, where I didn't see too much wrong with it.
I decided to come up with a half way measure; I moved the majority of the grunt work into a subclass of UITableViewController, cleaned up the XCode Demo project included with the source code and pushed it all back up to git hub. If you're at at all interested in this, I'd suggest checking out my fork of the EGOTablePullViewRefresh project on Git Hub.
Update: Another pull to refresh implementation is now in the three20 library by Facebook, but I'm not sure where exactly it's buried.



July 11th, 2011 - 04:26
Hi Jesse, thanks for sharing your codes. There is a readme file in there and it is an unix application, what exactly does it do? Just would like to get some clarification before opening it.
Thanks
Warmest, David
July 11th, 2011 - 07:41
Hi David, you can look at each file on github. The README is empty in this case. https://github.com/jessedc/EGOTableViewPullRefresh/blob/master/README
July 14th, 2011 - 01:31
Hi Jesse, Thanks for the prompt reply. Pardon a noob, but is there a particular reason why PullToRefreshTableViewController is separated from the RootViewController? Also in your demo,
- (void) reloadTableViewDataSource
wasn’t called/Nothing shows on the NSLog for me. Is there something I’m missing?
Thank you so much for your kind patience.
Warmest,
David