4

Some background to understand the question better:

On iOS 12 on iPad when I was using .actionSheet as a type for UIAlertController, it is shown as a popover. Also it was required to set a sourceRect and sourceView, otherwise it would crash.

But. When I would present such an alert in the ViewController that is presented as a formSheet/pageSheet/popover, then the alert wouldn't require the sourceRect/sourceView and would be presented as a iPhone style action sheet (but not as a popover as it should be on iPad). It looked like this:enter image description here

What happened with iOS 13:

On iOS13 this behaviour changed. The above case now is crashing and requiring the sourceRect/sourceView as it normally happens for iPads. Meaning even if the alert is presented in the formSheet/pageSheet/popover VC, it will still require the sourceRect/sourceView and now it will be presented as a popover (but not iPhone style action sheet).

Question:

I will appreciate a lot if someone knows how to keep the alert presentation in the same actionSheet style (but not popover) for such cases, as it was before on iOS 12.

Update: apparently this issue started to appear with iOS13.2 (not 13.0)

Tung Fam
  • 7,899
  • 4
  • 56
  • 63
  • I haven't found a way to do this. It looks like they simply withdrew the feature where you could make an alert appear _inside_ a presented view controller. My guess is that this was a loophole / edge case and they closed it. – matt Jan 07 '20 at 06:54
  • @matt got it, thanks for sharing. glad to hear i'm not the only one who has this issue. but sad they removed this "feature". – Tung Fam Jan 07 '20 at 06:57

1 Answers1

0

The desired behaviour is not possible since iOS 13.2 anymore.

Tung Fam
  • 7,899
  • 4
  • 56
  • 63