Hello @DTS Engineer,
Thank you for answering.
I'll try to explain a little bit more the end result I want.
Basically, something like what Apple uses for the "Silent Mode" floating pill/indicator at the top of the screen. Something I could use in my app to indicate success/errors/confirmations when some actions are performed by the user.
Let say an action is performed in the SheetContentView, I want to immediately present the indicator while also dismissing the sheet. I dismiss the sheet I want the PillNotificationView to stay visible, on top of everything. So it can't be an overlay/ZStack to the SheetContentView, and it can't be an overlay/ZStack to the MyView.
Regarding the code (this does not work as explained above because the PillNotificationView is overlaid to the MyView due to the ZStack)
ZStack {
MyView()
if isPillPresented {
PillNotificationView()
}
}
.sheet(isPresented: $isPresentingSheet) {
SheetContentView()
}
I want the view to be presented only once either above everything (no matter if the top view is the SheetContentView or MyView).
I hope it makes it more clear. Let me know.
Axel
PS:
This UI: https://github.com/ivanvorobei/SPIndicator
an old blog post talking about something similar is https://www.fivestars.blog/articles/swiftui-hud/