1

I would like to make my list in a form editable and sortable with the editMode. I've already tried using .environment(.editMode, .constant(.active)) on the list or on the ForEach loop, but unfortunately that didn't work. I'm happy about help.

What I want:

https://youtube.com/shorts/vSE6g-NVuE4?feature=share

Current code:

                        Form {
                            ForEach(elements, id: \.id) { element in
                                Text(element.name)
                            }
                            .onMove(perform: { _, _ in
                                
                            })
                            .onDelete(perform: { _ in
                                
                            })
                            .listRowSeparator(.hidden, edges: .bottom)
                            .environment(\.editMode, .constant(.active))
                        }
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.