Skip to content

Double Popover Behavior in Modal (iOS 26 Bug - TCA Only) #3836

@FredericRuaudel

Description

@FredericRuaudel

Description

Hi!

I've stumble upon an issue when displaying two popover in a row while in a "presented view controller".

Here is the sequence:

  • User taps share button in a modal → first popover (ShareForSureViewController) appears
  • User taps "Share for sure" → first popover dismisses
  • After 800ms delay → second popover (UIActivityViewController share sheet) should appear

Issue: On iOS 26 with TCA, when triggered from within a modal, instead of showing the second popover, the entire modal view controller is dismissed. This does not occur in:

  • Vanilla UIKit version (works correctly)
  • iOS < 26 (works correctly)
  • Main view controller (no modal) — same sequence works correctly

Affected code: ShareSheetBugiOS26TCA/ModalViewController.swift — the TCA presentation logic for the share sheet popover (lines 76-92) fails on iOS 26 when triggered from within a modal, causing the modal to dismiss instead of presenting the second popover.

Note that this is not a "share sheet" issue, if I setup the first popover in a loop ("share for sure" button displaying itself instead of shareSheet), it behaves the same way.

Here is a video recording of the issue:

https://github.com/user-attachments/assets/d39ff27a-d05a-4b0b-863f-0ecf399dacf7
(we can see at the end that instead of displaying the share sheet, the green modal is dismissed)

(this issue is kind of linked to the discussion here but this time, adding or increasing the delay doesn't solve the issue, so the problem has worsen with iOS 26)

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

The second popover should be displayed

Actual behavior

the presented view controller is dismissed instead

Reproducing project

And a sample code to reproduce the issue:

ShareSheetBugiOS26.zip

This sample code includes two targets, one in Vanilla UIKit and one in TCA + UIKit Navigation.

So if you run the Vanilla UIKit version in both iOS 26 and iOS 18, every buttons works correctly
And if you run the TCA version, all buttons works correctly in iOS 18 and in iOS 26 all works correctly except the trailing share button in the modal.

The Composable Architecture version information

'1.23.1', 'main'

Destination operating system

'iOS 26'

Xcode version information

Version 26.2 (17C52)

Swift Compiler version information

swift-driver version: 1.127.14.1 Apple Swift version 6.2.3 (swiftlang-6.2.3.3.21 clang-1700.6.3.2)
Target: arm64-apple-macosx26.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working due to a bug in the library.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions