Greetings,
I've managed to get the SectionedFetchRequest
to work as I want to, however, I've spent a lot of time trying to display the count of items in each Sections
.
I've used the simple section.count
and while it does not throw an error, it does not build either.
Here is some bits of code for context:
@SectionedFetchRequest(
sectionIdentifier: \MeasureData.month,
sortDescriptors: [SortDescriptor(\MeasureData.measureDate, order: .reverse)]
)
public var sectionedMeasures: SectionedFetchResults<String, MeasureData>
List {
ForEach(sectionedMeasures) { section in
Section(header:
Text(section.id)
+ Text(" (")
//+ Text(section.count)
+ Text(")")
){
ForEach(section) { measure in
.........
}
}
}
}
As soon as I uncomment the line + Text(section.count)
, nothing builds anymore.
Any tips would be appreciated :)
Thank you