Created
July 24, 2014 00:42
-
-
Save StuartFarmer/6aa65298eb04b4c7c19d to your computer and use it in GitHub Desktop.
Pull-up to Refresh View in Obj-C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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