Is there a standard way in iOS 5 to do delete confirmation like in Contacts?

cocoa-touch, ios, iphone

Solution

It's a `UIActionSheet` with the destructive button set. See the documentation.

e.g.

// Create the action sheet
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:nil 
                                                   delegate:self 
                                          cancelButtonTitle:@"Cancel" 
                                     destructiveButtonTitle:@"Delete" 
                                         otherButtonTitles:nil];

...

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    if (buttonIndex == actionSheet.destructiveButtonIndex) {
        // Do the delete
    }
}

Problem

Is there a standard way in iOS 5 to show delete confirmation as in this screenshot? If there is no standard way, any solution will be good.

Original source