mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
@@ -105,6 +105,8 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable {
|
||||
parentNavController.interactivePopGestureRecognizer?.delegate = poppableDelegate
|
||||
}
|
||||
|
||||
navigationItem.leftItemsSupplementBackButton = true
|
||||
|
||||
pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:])
|
||||
pageViewController.delegate = self
|
||||
pageViewController.dataSource = self
|
||||
@@ -225,6 +227,25 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable {
|
||||
starBarButtonItem.accLabelText = NSLocalizedString("Star Article", comment: "Star Article")
|
||||
}
|
||||
|
||||
configureUnreadCountView()
|
||||
|
||||
}
|
||||
|
||||
func configureUnreadCountView() {
|
||||
guard let controllers = poppableDelegate.navigationController?.viewControllers,
|
||||
controllers.count >= 2 else { return }
|
||||
for controller in controllers {
|
||||
if let feedController = controller as? MasterFeedViewController {
|
||||
if feedController.coordinator.timelineUnreadCount > 0 {
|
||||
let unreadCountView = MasterTimelineUnreadCountView(frame: .zero)
|
||||
unreadCountView.unreadCount = feedController.coordinator.timelineUnreadCount
|
||||
unreadCountView.setFrameIfNotEqual(CGRect(x: 0, y: 0, width: unreadCountView.intrinsicContentSize.width, height: unreadCountView.intrinsicContentSize.height))
|
||||
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: unreadCountView)
|
||||
} else {
|
||||
navigationItem.leftBarButtonItem = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func contentScrollView(for edge: NSDirectionalRectEdge) -> UIScrollView? {
|
||||
@@ -287,6 +308,7 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
@objc dynamic func unreadCountDidChange(_ notification: Notification) {
|
||||
|
||||
Reference in New Issue
Block a user