以下に示すような削除確認を作成するにはどうすればよいですか?

UIActionSheetを使用する必要があります。
このようなアクションシートを作成できます
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:@”YOUR_ACTION_SHEET_TITLE”
delegate:self
cancelButtonTitle:@”Cancel”
destructiveButtonTitle:@”Erase Iphone”
otherButtonTitles:nil];
[actionSheet showInView:self.view];
[actionSheet release];//If you are not using ARC
UIActionSheetDelegateメソッドを実装する必要があります
- (void)actionSheet:(UIActionSheet *)actionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0){
//do your action
}else if(buttonIndex == 1){
// do your other action
}
}
これはUIActionSheetのインスタンスです。赤いボタンは「破壊ボタン」と呼ばれ、黒いボタンは「キャンセルボタン」と呼ばれます。
これがデモです:
UIActionSheet *actSheet = [[UIActionSheet alloc] initWithTitle:@"The text to show on top. (Like the message about wiping the phone.)"delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete everything" otherButtonTitles:nil];
[actSheet ShowFromToolbar:self.toolbar];
[actSheet release];
他のボタンと一緒に写真に示されているものと同じものが必要な場合は、以下のUIActionSheetブログチュートリアルを使用し、スタンドアロンボタンのみが必要な場合は、以下のSO投稿に従ってください。
InterfaceBuilder(またはxCode4の同等のエディター)を使用してビューを作成します。ビューコントローラを作成します。次に、Core Animationを使用して、ビューをアニメーション化して下からスライドインします。