put back in code that eaiser to read
This commit is contained in:
@@ -18,11 +18,21 @@ class ContentModeViewModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var numberOfEntries: Int {
|
private var numberOfEntries: Int {
|
||||||
grouped.keys.map{
|
var num = 0
|
||||||
grouped[$0]!.values.reduce(0) { sum, array in
|
grouped.keys.forEach({
|
||||||
sum + array.count
|
let year = grouped[$0]
|
||||||
}
|
let monthKeys = year?.keys
|
||||||
}.reduce(0, +)
|
monthKeys?.forEach({
|
||||||
|
num += year![$0]!.count
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return num
|
||||||
|
|
||||||
|
// grouped.keys.map{
|
||||||
|
// grouped[$0]!.values.reduce(0) { sum, array in
|
||||||
|
// sum + array.count
|
||||||
|
// }
|
||||||
|
// }.reduce(0, +)
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@@ -36,7 +46,6 @@ class ContentModeViewModel: ObservableObject {
|
|||||||
private func getGroupedData() {
|
private func getGroupedData() {
|
||||||
grouped = PersistenceController.shared.splitIntoYearMonth()
|
grouped = PersistenceController.shared.splitIntoYearMonth()
|
||||||
numberOfItems = numberOfEntries
|
numberOfItems = numberOfEntries
|
||||||
print(numberOfItems)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func shouldShowVotingHeader() -> Bool {
|
public func shouldShowVotingHeader() -> Bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user