I have a foreach with a list of strings, Every element will have an expandable view. I want for all of them to start already expanded. And I also want to collapse/expand them individually.
@State myLists = ["list1", "list2", "list3"]
ForEach(myLists, id: \.self){myList in
DisclosureGroup(myList){
Text(myList)
}
}
I want all of them to start already expanded, and to collapse them individually.
I ve tried multiple links but most of them do not work unfortuately.
SwiftUI DisclosureGroup Expand each section individually -This one works but it start with all of them closed.