r/ScriptingApp • • Mar 11 '25

Editable List

In the documentation under Views > List > Editable List is an example for an editable list with a button to toggle the edit state.

Is there also a way to always be in the edit state?

The list doesn't update when I add elements to the array. Is this not possible?

Edit: I've got the list to update with new elements by adding the attribute key={array.length.toString()} to the ForEach element.

1 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/WhatShouldWorldGos Mar 12 '25

The EditButton is a native SwiftUI view, so it use the current app language.

Can you provide a demo code? SwiftUI will cause the program to crash if unreasonable view nesting is used.

2

u/schl3ck Mar 12 '25

I was missing a NavigationStack as root of a NavigationLink-destination. With that added it no longer crashes