From 3b3a2f80ae3abf2093c79132757f189f0dadc7af Mon Sep 17 00:00:00 2001 From: Gianni Carlo Date: Sun, 9 Feb 2025 12:19:13 -0500 Subject: [PATCH] Add chapter title for voice over in the player screen --- BookPlayer/Player/Player Screen/PlayerViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BookPlayer/Player/Player Screen/PlayerViewController.swift b/BookPlayer/Player/Player Screen/PlayerViewController.swift index 677b84fa..ecc1fb96 100755 --- a/BookPlayer/Player/Player Screen/PlayerViewController.swift +++ b/BookPlayer/Player/Player Screen/PlayerViewController.swift @@ -141,7 +141,9 @@ class PlayerViewController: UIViewController, MVVMControllerProtocol, Storyboard self.chapterTitleButton.titleLabel?.numberOfLines = 2 self.chapterTitleButton.titleLabel?.textAlignment = .center self.chapterTitleButton.titleLabel?.lineBreakMode = .byWordWrapping - self.chapterTitleButton.isAccessibilityElement = false + /// Disabling traits here, as toggling the chapter context with this button does not have the same feedback + /// like with the `progressButton` action + self.chapterTitleButton.accessibilityTraits = [] // Based on Apple books, the player controls are kept the same for right-to-left languages self.progressSlider.semanticContentAttribute = .forceLeftToRight @@ -191,6 +193,7 @@ class PlayerViewController: UIViewController, MVVMControllerProtocol, Storyboard } self.chapterTitleButton.setTitle(progressObject.chapterTitle, for: .normal) + self.chapterTitleButton.accessibilityLabel = progressObject.chapterTitle if shouldSetSliderValue { self.progressSlider.setProgress(progressObject.sliderValue)