Skip to content

Commit e466e88

Browse files
authored
Merge pull request #1252 from TortugaPower/voiceover-chapter
Make the chapter title visible for VoiceOver
2 parents c52ab75 + 3b3a2f8 commit e466e88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

BookPlayer/Player/Player Screen/PlayerViewController.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ class PlayerViewController: UIViewController, MVVMControllerProtocol, Storyboard
141141
self.chapterTitleButton.titleLabel?.numberOfLines = 2
142142
self.chapterTitleButton.titleLabel?.textAlignment = .center
143143
self.chapterTitleButton.titleLabel?.lineBreakMode = .byWordWrapping
144-
self.chapterTitleButton.isAccessibilityElement = false
144+
/// Disabling traits here, as toggling the chapter context with this button does not have the same feedback
145+
/// like with the `progressButton` action
146+
self.chapterTitleButton.accessibilityTraits = []
145147

146148
// Based on Apple books, the player controls are kept the same for right-to-left languages
147149
self.progressSlider.semanticContentAttribute = .forceLeftToRight
@@ -191,6 +193,7 @@ class PlayerViewController: UIViewController, MVVMControllerProtocol, Storyboard
191193
}
192194

193195
self.chapterTitleButton.setTitle(progressObject.chapterTitle, for: .normal)
196+
self.chapterTitleButton.accessibilityLabel = progressObject.chapterTitle
194197

195198
if shouldSetSliderValue {
196199
self.progressSlider.setProgress(progressObject.sliderValue)

0 commit comments

Comments
 (0)