Adding VoiceOver Accessibility compatibility.#213
Open
awall1 wants to merge 6 commits intopkluz:masterfrom
Open
Adding VoiceOver Accessibility compatibility.#213awall1 wants to merge 6 commits intopkluz:masterfrom
awall1 wants to merge 6 commits intopkluz:masterfrom
Conversation
Closed
Collaborator
|
Hi, thanks for the PR. Can you upload some screens about what changes with this feature? |
Author
|
@PGLongo funny thing is, there are no visual changes. Only someone using VoiceOver (a blind person) will be able to hear the difference. VoiceOver is an accessibility tool built into iOS that will read out loud what each element on a screen is. switch content {
case .success:
self.accessibilityLabel = "Success!"
case .error:
self.accessibilityLabel = "Error!"
case .image(_),
.rotatingImage(_):
self.accessibilityLabel = "Image"
case .label(let title):
guard let label = title else { break }
self.accessibilityLabel = label
case .labeledSuccess(let title, let subtitle),
.labeledError(let title, let subtitle),
.labeledProgress(let title, let subtitle),
.labeledImage(_, let title, let subtitle),
.labeledRotatingImage(_, let title, let subtitle):
guard title != nil || subtitle != nil else { break }
self.accessibilityLabel = (title ?? "") + "\n" + (subtitle ?? "")
default:
self.accessibilityLabel = "Please wait."
}The labels aren't ideal in that they don't always present with perfect context (i.e. "Image" tells me nothing), but it's at least a start. |
PGLongo
requested changes
Nov 28, 2017
Speakus
added a commit
to Speakus/PKHUD
that referenced
this pull request
Apr 20, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is in reference to: #212
I've added some generic Accessibility Labels to the content view for each type. If there is a specific title or subtitle, it will speak that text instead.
Known issue: After HUD is dismissed, the VoiceOver will focus on the first UI element directly behind it (typically right in the center).