Replies: 1 comment 17 replies
-
Hi @ysmaliak, this is not a bug with the library, but rather just how UIKit (and even SwiftUI) work. You cannot simultaneously dismiss and present controllers, and you can't even simultaneously present two sheets at once. There is even some logs in the console of your app letting you know this wrong:
The fix is to space out the However, I also tested this code in iOS 18.1 and things seem to work as intended. So perhaps UIKit has fixed some bugs. I'm not sure it will always work, but at least this simple use case seems to work as expected. Since this isn't an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
-
Description
There is a bug in the modal presentation behavior when replacing child views. Specifically:
The replacement operation is not working as expected. The behavior is inconsistent and incorrect, resulting in improper display or failure to update the modal's content.
Note: this is a UIKit project.
Checklist
main
branch of this package.Expected behavior
The first child should be dismissed, and the second child should be presented.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-09.at.18.00.02.mp4
Actual behavior
Sometimes (randomly), the parent modal is dismissed when trying to present the second child.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-09.at.17.59.49.mp4
Steps to reproduce
Sample project: https://github.com/ysmaliak/tca-navigation-test
The Composable Architecture version information
1.14.0
Destination operating system
iOS 17.5
Xcode version information
15.4
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions