When presenting a UIAlertController of style UIAlertControllerStyleActionSheet from Dine.AddItemViewController, I receive the following error message:
Your application has presented a UIAlertController (<UIAlertController: 0x1040c4400>) of style UIAlertControllerStyleActionSheet from Dine.AddItemViewController (<Dine.AddItemViewController: 0x112816e00>). The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
Steps to Reproduce
Present a UIAlertController of style UIAlertControllerStyleActionSheet from any view controller.
Attempt to present it without specifying the sourceView, sourceRect, or barButtonItem.
Expected Behavior
The action sheet should be presented without any error on all devices, particularly iPads, by providing the necessary popoverPresentationController properties.
Actual Behavior
The application throws an error and the action sheet does not appear correctly on iPads.
Description
When presenting a
UIAlertController
of styleUIAlertControllerStyleActionSheet
fromDine.AddItemViewController
, I receive the following error message:Steps to Reproduce
UIAlertController
of styleUIAlertControllerStyleActionSheet
from any view controller.sourceView
,sourceRect
, orbarButtonItem
.Expected Behavior
The action sheet should be presented without any error on all devices, particularly iPads, by providing the necessary
popoverPresentationController
properties.Actual Behavior
The application throws an error and the action sheet does not appear correctly on iPads.
Code Example
Here is an example of the code causing the issue:
Environment