From 3fd92fd63e7b88af64f8d1185468a922ef0a77cf Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Sun, 13 Feb 2022 08:08:51 +0800 Subject: [PATCH] suppress unread count on iPad --- iOS/Article/ArticleViewController.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index c925fcaae..05310ab86 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -295,13 +295,15 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable { } public func updateUnreadCountIndicator() { - if currentUnreadCount > 0 { - let unreadCountView = MasterTimelineUnreadCountView(frame: .zero) - unreadCountView.unreadCount = currentUnreadCount - unreadCountView.setFrameIfNotEqual(CGRect(x: 0, y: 0, width: unreadCountView.intrinsicContentSize.width, height: unreadCountView.intrinsicContentSize.height)) - navigationItem.leftBarButtonItem = UIBarButtonItem(customView: unreadCountView) - } else { - navigationItem.leftBarButtonItem = nil + if UIDevice.current.userInterfaceIdiom == .phone { + if currentUnreadCount > 0 { + let unreadCountView = MasterTimelineUnreadCountView(frame: .zero) + unreadCountView.unreadCount = currentUnreadCount + unreadCountView.setFrameIfNotEqual(CGRect(x: 0, y: 0, width: unreadCountView.intrinsicContentSize.width, height: unreadCountView.intrinsicContentSize.height)) + navigationItem.leftBarButtonItem = UIBarButtonItem(customView: unreadCountView) + } else { + navigationItem.leftBarButtonItem = nil + } } }