Goal: I'm trying to create a custom sheet that behaves more or less like a normal sheet.
How: I'm using an overlay on top of my main view and changing its content to the view I need to display.
Like so:
MainView()
.overlay {
CustomSheet(content: SomeView())
}
Problem: When I open a normal sheet, the sheet goes on top of everything, including the overlay that's on the main view.
Question: How can I make the overlay open on top of every view (including a sheet
and a fullScreenCover
) the same way a normal sheet does?
The solution has to work on iOS 15 and above
Thanks :)