Questions tagged [uiactionsheet]

UIActionSheet and UIActionSheetDelegate is deprecated in iOS 8. To create and manage action sheets in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet. The UIActionSheet class of the Apple iOS can be used to present to user a modal view with a descriptive text and some buttons the user can choose from. An action sheet displays a set of choices related to a task the user initiates.

The action sheet has two different appearances. On iPhone (), an action sheet always emerges from the bottom of the screen and hovers over the application’s views (an action sheet for Safari on iPhone is shown above). The side edges of an action sheet are anchored to the sides of the screen, which reinforces its connection to the app and to the user’s most recent action.

On iPad (), an action sheet is always displayed within a popover; it never has full-screen width. An action sheet can cause a popover to appear, or it can appear within a popover that is already open. In both cases, there is a strong visual connection between the action sheet and the user’s action.

An action sheet always contains at least two buttons that allow users to choose how to complete their task. When users tap a button, the action sheet disappears. An action sheet does not include a title or explanatory text, because it appears in immediate response to a user action.

Resources:

1000 questions
7
votes
3 answers

Showing a UIActionSheet

I was wondering how to show a UIActionSheet from the bottom of the screen. I have tried using the showInView: method with MainView as the view to show it in but I get the MainView Undeclared error.
Mark Szymanski
  • 56,590
  • 24
  • 70
  • 87
6
votes
1 answer

How to dismiss UIActionSheet with close button and avoid crash?

I have read on another post (how to dismiss action sheet) that I can use [actionSheet dismissWithClickedButtonIndex:0 animated:YES]; to dismiss the uiactionsheet with the close button, as defined in: UIActionSheet *actionSheet = [[UIActionSheet…
6
votes
1 answer

Dismissing UIActionSheet from UIBarButtonItem on an iPad

I have a UIToolbar with several UIBarButtonItems that show various UIActionSheets using showFromBarButtonItem:. On the iPad, when one of those Action Sheets is on the screen, touching anywhere outside the Action Sheet removes it and does nothing…
Amiram Stark
  • 2,208
  • 22
  • 32
6
votes
0 answers

SwiftUI from UIHostingController: showing ActionSheet gives warning about detached view controller

I have created a SwiftUI view which I show in a MKMapView's annotation callout. I use UIHostingController to wrap the SwiftUI view, and use annotationView's detailCalloutAccessoryView property to set the view and display it. This works fine for the…
Z S
  • 7,039
  • 12
  • 53
  • 105
6
votes
3 answers

How to customize Buttons in UIActionSheet?

I want to change the image of the buttons of UIActionSheet, I have images for each button, and I want each button show the image I want. I searched the web I found a lot of answers but they didn't work. Here is the initialization of the…
user784625
  • 1,928
  • 5
  • 24
  • 38
6
votes
2 answers

UIDatePicker in PopoverView in iPad

I have an iPad specific application running iOS 3.2.2 which displays a settings view in a ui popover. This all renders great, but now I'm trying to get a date picker to render inside the view and not sure what the best approach is for displaying…
Chelsea
  • 6,751
  • 5
  • 29
  • 31
6
votes
1 answer

Wrong UIActionSheet layout in popover

I’ve got an UIActionSheet with a single button that I show in a popover. In landscape mode there is a plenty of space around the popover, so that it displays with an arrow in the middle and everything is fine: In portrait the popover has to be…
zoul
  • 102,279
  • 44
  • 260
  • 354
6
votes
2 answers

Customised UIActionSheet

How can I customise UIActionSheet to look like this : Also, if I customise UIActionSheet, will there be a chance of app getting rejected ?
Nitish
  • 13,845
  • 28
  • 135
  • 263
6
votes
1 answer

UIAlertController and UIPopoverController in a Universal App?

I am working on a universal app for the iPhone 6S / 6S Plus / and iPad form factors. Normally, presenting actionsheets / alertviews on an iPhone-only app is a simple manner. But my application crashes when I attempt to present these on an iPad,…
6
votes
4 answers

UIActionSheet/UIAlertController multiline text

This is the code I am writing to display UIActionSheet. actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"updateresponseforrecurring", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil)…
Nitish
  • 13,845
  • 28
  • 135
  • 263
6
votes
1 answer

How to get the title of the selected UIActionSheet button into a label?

I have a button with some options. - (IBAction)monstrarActionSheet:(id)sender { UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"Titulo" delegate:self …
maevy
  • 363
  • 1
  • 3
  • 12
6
votes
7 answers

How to add UIDatePicker in UIAlertController in iOS8?

I am working on a project which I had already released with iOS-7. But now as the action sheet is making problem so I am now implementing UIAlertController. Following is the code which I am using for showing UIAlertController with…
Sanchit Paurush
  • 6,114
  • 17
  • 68
  • 107
6
votes
3 answers

How do you remove one-time-use class variables from Objective-C code?

I'm writing some Objective-C code and I've frequently hit the situation where I have to use a class variable to store a value for one time use. After consuming it I no longer need it. To me, storing this value in a class variable seems like code…
Gavin Miller
  • 43,168
  • 21
  • 122
  • 188
6
votes
2 answers

How to display UIActionSheet just below top navigation status bar on iPhone

I would like to display an action sheet sliding from just below the very top status bar. When I use the navigationBar as the view to show in, the sheet is still displayed at the bottom of the screen. How can I show it originating from the top…
Alexi Groove
  • 6,646
  • 12
  • 47
  • 54
6
votes
3 answers

tintColor of UIActionSheet (or UIAlertView) (iOS 7+)

Is it possible to have buttons in UIActionSheet in iOS 7's tintColor color? I mean if my app is in brand tintColor, for example red, I don't want blue buttons in action sheet. The same with UIAlertView.
user500
  • 4,519
  • 6
  • 43
  • 56