You can also configure this in Interface Builder. Although it works at the moment, it only stores a couple lines of code.
Select the TableViewController scene and in the Attributes Inspector, you will find a drop-down list for the Update option. Set to Enabled. In the hierarchy of the view manager, you will notice that an “update control” has been added (you will not see anything visually added to the scene itself). What is strange is that after connecting Refresh Control to IBAction (value change event), the event does not seem to fire. I suppose the error is (?), But meanwhile, setting "Refreshing" to enable creates a UIRefreshControl object and sets it to the refreshControl property of the view controller. In this case, you can add an event processing line to the viewDidLoad method:
[self.refreshControl addTarget:self action:@selector(refreshView:) forControlEvents:UIControlEventValueChanged];
In your refreshView: method, you can do some work and then stop the refresh animation:
- (void)refreshView:(UIRefreshControl *)sender {
J Shapiro Sep 27 '12 at 18:40 2012-09-27 18:40
source share