Last active
December 16, 2015 21:29
-
-
Save myaaaaa-chan/5499726 to your computer and use it in GitHub Desktop.
UIRefreshControlで引っ張って更新をする ref: http://qiita.com/myaaaaa_chan/items/fc3adb23d16171de5abe
This file contains hidden or 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
| - (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