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:
- Is there a supported way to have a SwiftUI
confirmationDialog present from the toolbar's overflow button, so that it morphs out of it? - 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.