why sheet inside sheet is not working

Generated on 8/13/2024

1 search

It seems like you're encountering an issue with using a sheet inside another sheet in SwiftUI. This might be related to how SwiftUI handles view hierarchies and presentation. In the session titled "Demystify SwiftUI containers" from WWDC 2024, there is a discussion about the flexibility and composition of SwiftUI views, which might provide some insights into your issue.

In SwiftUI, custom containers don't support sections by default, and additional work is needed to enable them. This is discussed in the session, where the presenter talks about using new APIs like Foreach section of to iterate over sections within a view. This approach might help in organizing your views better and could potentially address issues related to nested presentations like sheets.

For more detailed guidance, you might want to check out the section on Sections in the "Demystify SwiftUI containers" session, which starts at 10:42. This part of the session covers how to handle sections and might provide useful techniques for managing complex view hierarchies in SwiftUI.