iPhone Pull Down Refresh like Tweetie
Asked Answered
C

5

43

I am trying to find an example of placing an element above the Table View outside the normal scrollable region. How would I do this? An example would be what the Tweetie 2 app for the iPhone does to refresh tweets.

Sample code would be extremely helpful.

Communicant answered 28/10, 2009 at 1:46 Comment(5)
If you do use this, be mindful that there is a patent pending for the concept: appft.uspto.gov/netacgi/…Orelle
Interesting, I know Tweetie did it best, not sure it did this first. Also to note that this question was asked well before the patent was even filed.Communicant
I believe that when the patent is filed is irrelevant. The criteria is "when did Tweetie 2 release this functionality," and "did anyone else release a product that did the same thing before them?"Microcurie
Hate to say this, but it should be criminal to patent a paradigm that users expect to work, especially one like this one.Scandium
Software related patents are irrelevant outside USAMimamsa
C
52

I did find the answer to my own question, for anyone who is interested.

EGOTableViewPullRefresh

I tried this solution and it works great! It is almost identical to the Tweetie Pull Down refresh.

Communicant answered 28/10, 2009 at 3:2 Comment(5)
I spent a little bit of time on EGOTableViewPullRefresh today and moved the main code into a UITableViewController subclass, it might be easier for some people to implement. github.com/jessedc/EGOTableViewPullRefreshAppear
I think the EGOTableViewPullRefrehsh isn't a very easy solution. But if you can use it: It's the best way ;-)Thirteen
I can't find a license on the github site.Seashore
@Seashore It's in the source: github.com/enormego/EGOTableViewPullRefresh/blob/master/…Madden
I think EGOTableViewPullRefresh doesn't supported by author. 2 years no commits. Is enormego alive?Ricci
M
20

Here's an alternative to EGOTableViewPullRefresh:

http://blog.leahculver.com/2010/12/iphone-pull-to-refresh.html

Source available on github here:

https://github.com/leah/PullToRefresh

It's slightly easier to use from the developers point of view, though I did go with EGOTableViewPullRefresh in the end as I preferred how it looked.

Madden answered 2/12, 2010 at 12:10 Comment(1)
It has a bug when you use it with plain table that has sections. When you scroll up while refreshing, table cells will appear above section header.Heddie
Y
4

Start with iOS 6.0, there is a standard control called UIRefreshControl within sdk. apple doc here

Yellow answered 27/2, 2013 at 9:15 Comment(0)
S
3

Here what you can do with iOS 6 and later:

- (void)viewDidLoad { 
    // other initialization
    self.refreshControl = [[UIRefreshControl alloc] init];
    [self.refreshControl addTarget:self
                            action:@selector(myRefresh)
                  forControlEvents:UIControlEventValueChanged];
}

Your refresh method:

- (void)myRefresh {  
    // get refreshed data for table view
}  

You end refreshing in reloadData:

- (void)reloadData {  
    [self.tableView reloadData];  

    // End the refreshing   
    if (self.refreshControl) {  
        [self.refreshControl endRefreshing];  
    }  
}    

Then you are all set!

Strahan answered 10/2, 2015 at 2:24 Comment(0)
M
0

You are looking for UIRefreshControl which is available for every UITableViewController - https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIRefreshControl_class/Reference/Reference.html

Mimamsa answered 9/11, 2013 at 21:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.