Confirmation dialog anchor for a ToolbarOverflowMenu item

I have a destructive action exposed as a toolbar item, which might be collapsed into a ToolbarOverflowMenu.

I'd present the delete confirmation as a confirmation dialog anchored to the button that triggered it. But when the action is inside the overflow menu, the menu item isn't a view I can anchor it to.

What's the recommended pattern for the delete confirmation in that case? Is an alert the intended fallback, is there a supported way to anchor a confirmation dialog to a toolbar overflow item, or would you recommend a different approach altogether?

Hello! This was answered in the Summary of the iPhone Duo Group Lab https://developer.apple.com/forums/thread/847644?answerId=906296022#906296022

What's the recommended pattern for a confirmation dialog triggered from a ToolbarOverflowMenu item, since the menu isn't a view to anchor to?

When working with ToolbarOverflowMenu (SwiftUI) and additionalOverflowItems (UIKit), actions are placed directly into the toolbar's overflow menu. Because the menu itself is managed by the system and is not a view you can directly anchor to, presenting a confirmation dialog requires standard state-driven presentation rather than attaching the modifier to the menu item directly. In SwiftUI, combine the ToolbarOverflowMenu and the confirmationDialog modifier by linking them to a shared state variable within your view structure. To learn more about overflow menus, see Designing for iPhone Duo.

Following up on the reply pointing me to the iPhone Duo Group Lab summary. That answer covers how to trigger the dialog — state-driven presentation bound to a shared state variable — which is what I'm already doing. What it doesn't cover is how the dialog presents, and that's the part I'm stuck on.

Since iOS 26, a dialog anchored to a bar button item animates out of that item rather than merely pointing at it. The documentation for UIPopoverPresentationController.sourceItem states it directly: "In iOS 18 and earlier, the popover's arrow points to the specified item. In iOS 26 and later, the popover animates from and replaces the specified item until someone selects an action item or dismisses the popover."

When the action lives in a ToolbarOverflowMenu, there is no item for the dialog to come from. State-driven presentation can only attach the confirmationDialog modifier to a view, so the dialog presents over that view's content with a pointer to whatever sits beneath it. What's lost isn't arrow direction: the dialog no longer reads as originating from the control that was tapped, and its pointer indicates content unrelated to the action. This is the same on iPhone and iPad.

UIKit does expose the overflow button as an anchor. UINavigationItem.overflowPresentationSource is documented as "the item you can use as an anchor to present a custom UI from the overflow menu button," and returns a UIPopoverPresentationControllerSourceItem whenever the overflow button is visible — precisely what sourceItem takes. So the overflow button seems to be anchorable at the platform level, but I can't find the equivalent mechanism from SwiftUI.

So my question is:

  1. Is there a supported way to have a SwiftUI confirmationDialog present from the toolbar's overflow button, so that it morphs out of it?
  2. If not, is an alert the intended presentation in this case — given that an alert has no source item, so nothing is lost by it not having one?

If it's neither, I'd like to know which behaviour is considered correct here, so I'm not working against the intended design.

Confirmation dialog anchor for a ToolbarOverflowMenu item
 
 
Q