iPhone Pull Down Refresh like Tweetie

送分小仙女□ 提交于 2019-11-27 06:16:22

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.

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.

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

us_david

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!

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!