mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Continue progress on modern look.
This commit is contained in:
@@ -70,6 +70,14 @@ final class TimelineArticlesManager {
|
||||
|
||||
final class TimelineCollectionViewController: UICollectionViewController {
|
||||
|
||||
var items = [any Item]() {
|
||||
didSet {
|
||||
updateTitle()
|
||||
}
|
||||
}
|
||||
|
||||
private static var defaultTitle = "Articles" // ToDo: localize
|
||||
|
||||
private let timelineArticlesManager = TimelineArticlesManager()
|
||||
|
||||
typealias DataSource = UICollectionViewDiffableDataSource<TimelineSectionID, TimelineArticleID>
|
||||
@@ -90,7 +98,8 @@ final class TimelineCollectionViewController: UICollectionViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
title = "Articles"
|
||||
navigationItem.largeTitleDisplayMode = .never
|
||||
updateTitle()
|
||||
|
||||
collectionView.register(TimelineCell.self, forCellWithReuseIdentifier: TimelineCell.reuseIdentifier)
|
||||
|
||||
@@ -122,4 +131,8 @@ private extension TimelineCollectionViewController {
|
||||
|
||||
dataSource.apply(snapshot, animatingDifferences: true)
|
||||
}
|
||||
|
||||
func updateTitle() {
|
||||
title = items.first?.title ?? Self.defaultTitle
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user