Skip to content

Instantly share code, notes, and snippets.

@myaaaaa-chan
Last active December 16, 2015 21:29
Show Gist options
  • Select an option

  • Save myaaaaa-chan/5499726 to your computer and use it in GitHub Desktop.

Select an option

Save myaaaaa-chan/5499726 to your computer and use it in GitHub Desktop.
UIRefreshControlで引っ張って更新をする ref: http://qiita.com/myaaaaa_chan/items/fc3adb23d16171de5abe
- (void)viewDidLoad
{
[super viewDidLoad];
UIRefreshControl *refreshControl = [[UIRefreshControl alloc]init];
// 更新アクションを設定
[refreshControl addTarget:self action:@selector(onRefresh:) forControlEvents:UIControlEventValueChanged];
// UITableViewControllerにUIRefreshControlを設定
self.refreshControl = refreshControl;
}
- (void)onRefresh:(id)sender
{
// 更新開始
[self.refreshControl beginRefreshing];
// 更新処理をここに記述
// 更新終了
[self.refreshControl endRefreshing];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment