Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the chapter title visible for VoiceOver #1252

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion BookPlayer/Player/Player Screen/PlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down