how to remove delete button in SwiftUI List rows when in Edit Mode?

How would remove the delete button in SwiftUI List rows when in Edit Mode? Note the hamburger button on the right of the row that allows rows to be re-ordered needs to continue to function.


Background - Want a list that has the "re-order" rows functions always enabled. Edit mode seems to enable this (i.e. leave List in edit mode) however do not want the red delete button on each row.

Post not yet marked as solved Up vote post of callagga Down vote post of callagga
2.3k views

Replies

myList.deleteDisabled(true)

I just want to say that to use the modifier "deleteDisabled()", it must be INSIDE the list view you want to use it on and to make sure that the view you are trying to put the modifier on is mandatory to render, no matter what happens (like a ZStack containing the contents of each row of the list for example will always be made so you can put the modifier on the ZStack and put the stuff for each list's row inside that, and it will work)