Без Form
и Section
, я могу редактировать список:
var body: some View {
List {
ForEach(modeConfigurations.sorted, id: \.id) { item in
Text("\(item.defaultSortIndex)")
}
.onMove(perform: move)
}
.navigationBarItems(trailing:
EditButton()
)
} // Body
![enter image description here](https://i.stack.imgur.com/lOsMn.png)
I'd like to edit inside a Section
of a Form
, but it doesn't work there:
var body: some View {
Form{
Section(header: Text("Sort")){
List {
ForEach(modeConfigurations.sorted, id: \.id) { item in
Text("\(item.defaultSortIndex)")
}
.onMove(perform: move)
}
.navigationBarItems(trailing:
EditButton()
)
} // Sort Section
} // Form
} // Body
I can't edit and the Text
inside ForEach
is not rendered as separate line.
введите описание изображения здесь
Как мне отредактировать List
внутри Section
из Form
?