You need to use UIActionSheet .
First you need to add the UIActionSheetDelegate to the UIActionSheetDelegate file.
Then you can reference the action table with:
UIActionSheet *popup = [[UIActionSheet alloc] initWithTitle:@"Select Sharing option:" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles: @"Share on Facebook", @"Share on Twitter", @"Share via E-mail", @"Save to Camera Roll", @"Rate this App", nil]; popup.tag = 1; [popup showInView:self.view];
Then you must handle each of the calls.
- (void)actionSheet:(UIActionSheet *)popup clickedButtonAtIndex:(NSInteger)buttonIndex { switch (popup.tag) { case 1: { switch (buttonIndex) { case 0: [self FBShare]; break; case 1: [self TwitterShare]; break; case 2: [self emailContent]; break; case 3: [self saveContent]; break; case 4: [self rateAppYes]; break; default: break; } break; } default: break; } }
This is deprecated for iOS 8.x https://developer.apple.com/documentation/uikit/uialertcontroller#//apple_ref/occ/cl/UIAlertController
ApolloSoftware Jun 20 '13 at 20:34 2013-06-20 20:34
source share