diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index 9141d36fb..e4684e881 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -169,7 +169,8 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner private static let logger = Logger(subsystem: Logger.nnwSubsystem, category: "MainTimelineViewController") /// Cells queued within this interval, such as for several thumbnail downloads that failed, are reloaded together. private static let cellReloadDelay: TimeInterval = 0.1 - /// A zero-size titleView or subtitleView crashes UINavigationBar layout, so empty labels get a space instead. + /// A zero-width titleView or subtitleView crashes UINavigationBar layout, so labels whose text measures zero width (empty, or only a combining mark) get a space instead. + /// private static let navigationBarPlaceholderText = " " // MARK: Constants @@ -316,16 +317,23 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner func updateNavigationBarTitle(_ text: String) { navigationItem.title = text if let label = navigationItem.titleView as? UILabel { - label.text = text.isEmpty ? Self.navigationBarPlaceholderText : text label.isUserInteractionEnabled = ((coordinator?.timelineFeed as? PseudoFeed) == nil) - label.sizeToFit() + setNavigationBarLabelText(label, text) } } func updateNavigationBarSubtitle(_ text: String) { if #available(iOS 26, *), let label = navigationItem.subtitleView as? UILabel { - label.text = text.isEmpty ? Self.navigationBarPlaceholderText : text label.isUserInteractionEnabled = ((coordinator?.timelineFeed as? PseudoFeed) == nil) + setNavigationBarLabelText(label, text) + } + } + + private func setNavigationBarLabelText(_ label: UILabel, _ text: String) { + label.text = text + label.sizeToFit() + if !(label.bounds.width > 0) { + label.text = Self.navigationBarPlaceholderText label.sizeToFit() } }