SDCAlertView icon indicating copy to clipboard operation
SDCAlertView copied to clipboard

Evaluate support to popover ActionSheet on iPad

Open lechuckcaptain opened this issue 4 years ago • 3 comments

Following Apple guidelines an ActionSheet should be displayed as a popover anchored to the UI item who generated it.

On iPad, UIKit requires that you display an action sheet inside a popover. Figure 2 shows an action sheet anchored to a bar button item.

More info here: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets

See screenshot: image

lechuckcaptain avatar May 13 '20 10:05 lechuckcaptain

I wish we could do that, but last I checked this wasn't (fully) possible without using some private API. I don't recall the details, but the README cautions against this as well:

This is because iOS doesn't support UIModalPresentationStyle.Custom for adaptive presentations (such as when presenting an action sheet from a bar button item).

sberrevoets avatar May 13 '20 16:05 sberrevoets

Thank you for the explanation, I didn't get from the README the actual problem. To be honest I prefer the behavior of your library instead of the Apple guidelines, but since the library mimic the standard UIAlertController, I thought it was worth to track the issue.

last I checked this wasn't (fully) possible without using some private API

Do you have a branch where it's possible to see your last experiments on the topic?

lechuckcaptain avatar May 13 '20 17:05 lechuckcaptain

Apologies for the late response. I don't have a branch that demonstrates the problem as this was a couple of years ago when I first added action sheet support, and enough has changed in those years that it might be possible now.

If you're still interested in this, feel free to submit a PR!

sberrevoets avatar Jul 06 '21 22:07 sberrevoets