HomeiOS Developmentios - SwiftUI sheet inside sheet will not present an alert

ios – SwiftUI sheet inside sheet will not present an alert


In my app, I’m presenting a sheet inside a sheet. On this second sheet, alerts is not going to perform. Is my solely resolution to alter the construction of my app, possibly to propagate the error up?

This may be seen in a SwiftUI preview with one thing like:

Textual content("Hey")
    .sheet(isPresented: .fixed(true), content material: {
        Textual content("World")
            .sheet(isPresented: .fixed(true), content material: {
                Textual content("third display")
                    .alert("Error", isPresented: .fixed(true), actions: {})
            })
    })

Should you transfer the alert as much as the “World” textual content, the alert seems:

Textual content("Hey")
    .sheet(isPresented: .fixed(true), content material: {
        Textual content("World")
            .alert("Error", isPresented: .fixed(true), actions: {})
            .sheet(isPresented: .fixed(true), content material: {
                Textual content("third display")
            })
    })

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments