I am attempting to place drugs under sections correlating to their class but im getting multiple sections for each drug I add of the same class. Im not sure how much this process differs when using model macros.
Current Result
<code> List {
ForEach(activeStash) { drug in
Section(header: Text(drug.substanceClass)) {
NavigationLink(destination: StashLinkView(stashed: drug)) {
Text(drug.substance)
}
}
}
}
</code>
<code> List {
ForEach(activeStash) { drug in
Section(header: Text(drug.substanceClass)) {
NavigationLink(destination: StashLinkView(stashed: drug)) {
Text(drug.substance)
}
}
}
}
</code>
List {
ForEach(activeStash) { drug in
Section(header: Text(drug.substanceClass)) {
NavigationLink(destination: StashLinkView(stashed: drug)) {
Text(drug.substance)
}
}
}
}