In UIKit you can select multiple rows of a UITableView by using allowsMultipleSelection - can this be done with the List in SwiftUI?
First add this to your view
@State var selectedItems = Set()
The type of the Set
depends on the type you use to id:
the items in the ForEach
Next declare the List
List(selection: $selectedItems) {
ForEach(items, id: \.id) { item in
Text("\(item.name)")
}
}
Now whatever you select gets added to the selectedItems Set
remember to clear it out after you use it.