Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Code to implement a UIRefreshControl in a UITableView (Objective C).
/* Created by Hersh Bhargava of H2 Micro ( */
UIRefreshControl *refreshControl;
//Main Load
refreshControl = [[UIRefreshControl alloc] init];
[tableView addSubview:refreshControl];
//Main Begin Refresh
[refreshControl beginRefreshing];
[refreshControl setHidden:false];
[tableView setContentOffset:CGPointMake(0, -refreshControl.frame.size.height) animated:YES];
//Main Ends Refresh
[refreshControl endRefreshing];
[refreshControl removeFromSuperview];
[tableView reloadData];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment