feat: update mechanism of calculating number of people taking tags

This commit is contained in:
jk234ert 2021-04-02 17:05:06 +08:00
parent 4f77688d03
commit a9d35109fd
1 changed files with 5 additions and 1 deletions

View File

@ -152,7 +152,11 @@ extension HashtagTimelineViewController {
let sortedHistory = histories.sorted { (h1, h2) -> Bool in
return h1.day > h2.day
}
subtitle = sortedHistory.first?.accounts
let peopleTalkingNumber = sortedHistory
.prefix(2)
.compactMap({ Int($0.accounts) })
.reduce(0, +)
subtitle = "\(peopleTalkingNumber)"
}
}
}