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.
Checklist
Motivation and Context
The current implementation isn't really usable for users that rely on assistive technologies especially with VoiceOver. Additionally, there is currently no way for developer that are using this framework to make their implementations accessible. This PR aims to provide a usable VoiceOver support per default and additionally provides public apis for developers to create a better experience.
I tested my changes on my device (iPhone 6, iOS 11.02) with VoiceOver and Switch Control enabled.
Description
Images are currently not accessible at all for VoiceOver users. I introduced a new variable
imageAccessibilityLabel
to PageBulletinItem to enable developers to add a description to their images. Images without description stay hidden for VoiceOver users.Tapping on empty areas isn't easy or impossible for visually impaired users. Therefore, I added support for the escape gesture (swiping a Z with two fingers) for VoiceOver users and the escape button for Switch Control users if the current BulletinItem
isDismissable
.As this projects only uses a single ViewController for different items and doesn't uses a UINavigationController, the assistive technologies doesn't get notified that the screen and their content changes. Therefore, I added
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, newArrangedSubviews.first)
which notifies the system to recalculate the accessibility tree and additionally moves the focus back to the first element of the new item instead of keeping the focus on the tapped button.I also added the
UIAccessibiltyTraitHeader
to titleLabel to support VoiceOvers header rotor.accessibilityViewIsModal
makes sure that VoiceOver ignores all the elements behind the current BulletinBoard which would otherwise still be accessible via VoiceOver.