Hassan Zaheer Hassan Zaheer - 1 year ago 113
iOS Question

Pull to refresh on UITableView Inside a UIViewController

I am trying to implement the pull to refresh functionality in my application. The architecture is such that the there is a

inside a
. I want to be able to refresh the tableview on pull down. I tried the code below in the
method, but it does not work. Can any one tell me where am I wrong in implementation?

UIRefreshControl *refresh = [[UIRefreshControl alloc] init];
refresh.tintColor = [UIColor grayColor];
refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(get_vrns) forControlEvents:UIControlEventValueChanged];
[self.vrnTable addSubview:refresh];

Answer Source

UIRefreshControl without UITableViewController

Or you can use UITableViewController instead of a UIViewController.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download