Question Details

No question body available.

Tags

ios swift swiftui ios-animations

Answers (2)

Accepted Answer Available
Accepted Answer
February 17, 2026 Score: 0 Rep: 437 Quality: Medium Completeness: 0%

This bug seems to have been resolved since the release of iOS 26.3.

December 9, 2025 Score: 1 Rep: 31,655 Quality: Medium Completeness: 60%

The matched transition is unreliable because the source lives inside the TabView, while the destination is shown in a .sheet, which is presented in a completely separate layer. Sometimes SwiftUI still has the source view around when the sheet animates in, so the match works, and sometimes it doesn’t, so you get the default animation.

The @State vs @StateObject difference just makes the bug more consistent. With @State, the value only triggers a body update if the getter is actually read inside body. In this sample code, the @State property isn’t used in body at all, so changing it doesn’t cause a body update at the moment the sheet is presented. That means the matched source view stays in place long enough that the transition sometimes works.

With @StateObject, the publisher always causes body to be called when the published property changes, even if you don’t read the getter in body. That means the view hierarchy is always rebuilt right when the sheet presentation begins and that rebuild is what makes SwiftUI lose track of the matched source every single time.