Sunday, May 26, 2024
HomeiOS Developmentios - The way to stop checklist row animation whereas Alert is...

ios – The way to stop checklist row animation whereas Alert is proven


I’m making an attempt to stop the ‘swipe-back’ animation after an alert is offered. Under is the reproducible code:

struct ContentView: View {
    @State personal var showingAlert = false

    var physique: some View {
        Checklist {
            Textual content("Archive")
                .swipeActions(edge: .trailing, allowsFullSwipe: false) {

                    Button {
                        showingAlert = true
                    } label: {
                        Picture(systemName: "archivebox.fill")
                    }
                    .tint(.yellow)
                }
                .alert("Archive?", isPresented: $showingAlert) {

                    Button("Archive") {
                       showingAlert = true
                    }
                    Button("Cancel", function: .cancel) {
                        showingAlert = false
                    }
                } message: {
                    Textual content("Some message")
                }
        }
    }
}

Right here is the way it seems:

gif example

However I would like the row to remain in place in order that the archive button is seen, and to animate again upon person interplay (in the event that they select cancel or archive). I assume that is potential?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments