I'm working on an array of filters which are connected to a database. The filters (categories in this case) are successfully rendered. However, there are many duplicates. I'm new to SwiftUI and I'm eager to know if there's any smart way to remove duplicates in my foreach.
Hope someone can help me! Thanks in advance!
Find the code below:
{
HStack(spacing: 8){
ForEach(artikel.content) { filter in
FilterButton2_0(selected: self.$selected, name: filter.categorie ?? "", selectedFilter: self.$selectedFilter)
}
}.padding(.leading, 20)
}