[Framework] Show top words for filtered items in the Feed List #12

Merged
javier merged 12 commits from framework/feed/top-words into main 2024-03-21 01:13:13 +00:00
Showing only changes of commit 0f4fb372e3 - Show all commits

View File

@ -40,7 +40,8 @@ public class FeedListViewController: UITableViewController {
image: UIImage.Icon.star, image: UIImage.Icon.star,
children: { children: {
FilterOption.allCases.map { option -> UIAction in FilterOption.allCases.map { option -> UIAction in
.init(title: option.text, .init(
title: option.text,
image: .init(systemName: option.icon) image: .init(systemName: option.icon)
) { [weak self] _ in ) { [weak self] _ in
self?.viewModel.filter(by: option) self?.viewModel.filter(by: option)
@ -90,7 +91,7 @@ public class FeedListViewController: UITableViewController {
_ tableView: UITableView, _ tableView: UITableView,
cellForRowAt indexPath: IndexPath cellForRowAt indexPath: IndexPath
) -> UITableViewCell { ) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: FeedItemCell.identifier) else { guard let cell = FeedItemCell.dequeue(from: tableView) else {
return .init() return .init()
} }
@ -159,10 +160,8 @@ private extension FeedListViewController {
} }
func registerTableCells() { func registerTableCells() {
tableView.register( FeedItemCell.register(in: tableView)
FeedItemCell.self, TopWordsCell.register(in: tableView)
forCellReuseIdentifier: FeedItemCell.identifier
)
} }
func setNavigationBar() { func setNavigationBar() {