Skip to content

Instantly share code, notes, and snippets.

@StuartFarmer
Created July 24, 2014 00:42
Show Gist options
  • Save StuartFarmer/6aa65298eb04b4c7c19d to your computer and use it in GitHub Desktop.
Save StuartFarmer/6aa65298eb04b4c7c19d to your computer and use it in GitHub Desktop.
Pull-up to Refresh View in Obj-C
// Put this in viewDidLoad where _webView is your targetted view
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[_webView.scrollView addSubview:refreshControl];
// Declare this method elsewhere in the implementation file
-(void)handleRefresh:(UIRefreshControl *)refresh {
// Code here
[refresh endRefreshing];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment