#pragma mark リストア
- (IBAction)restoreButton:(id)sender
{
NSLog(@"リストアボタン押した");
// コントローラを生成
UIAlertController * ac =
[UIAlertController alertControllerWithTitle:@"Restore"
message:@"Do you want to start the restoration ?"
preferredStyle:UIAlertControllerStyleAlert];
// Cancel用のアクションを生成
UIAlertAction * cancelAction =
[UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
// ボタンタップ時の処理
NSLog(@"Cancel button tapped.");
}];
// OK用のアクションを生成
UIAlertAction * okAction =
[UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
// ボタンタップ時の処理
[self startRestore];
NSLog(@"OK button tapped.");
}];
// コントローラにアクションを追加
[ac addAction:cancelAction];
[ac addAction:okAction];
// アラート表示処理
[self presentViewController:ac animated:YES completion:nil];
}