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.
SwiftUI essentials
Join us on a tour of SwiftUI, Apple’s declarative user interface framework. Learn essential concepts for building apps in SwiftUI, like views, state variables, and layout. Discover the breadth of APIs for building fully featured experiences and crafting unique custom components. Whether you’re brand new to SwiftUI or an experienced developer, you’ll learn how to take advantage of what SwiftUI has to offer when building great apps.
Migrate your TVML app to SwiftUI
SwiftUI helps you build great apps on all Apple platforms and is the preferred toolkit for bringing your content into the living room with tvOS 18. Learn how to use SwiftUI to create familiar layouts and controls from TVMLKit, and get tips and best practices.
What’s new in UIKit
Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.
Demystify SwiftUI containers
Learn about the capabilities of SwiftUI container views and build a mental model for how subviews are managed by their containers. Leverage new APIs to build your own custom containers, create modifiers to customize container content, and give your containers that extra polish that helps your apps stand out.