Giter Site home page Giter Site logo

cvs-health / ios-swiftui-accessibility-techniques Goto Github PK

View Code? Open in Web Editor NEW
119.0 7.0 10.0 2.82 MB

Demonstrates iOS SwiftUI Accessibility programming techniques using live good and bad examples that can be tested with VoiceOver and other AT. Includes documentation for developers explaining how to code accessible patterns for iOS.

License: Apache License 2.0

Swift 100.00%
a11y accessibility ios ios-accessibility mobile swiftui wcag dark-mode ipad iphone voiceover

ios-swiftui-accessibility-techniques's Introduction

iOS SwiftUI Accessibility Techniques

iOS SwiftUI sample code demonstrating a variety of good and bad accessibility coding techniques.

Demonstrates accessibility techniques for iOS SwiftUI apps using a collection of good and bad examples that can be tested with VoiceOver and other iOS assistive technologies.

Explains how to apply WCAG to iOS SwiftUI apps.

Using the app with VoiceOver and other iOS assistive technologies will demonstrate the right and wrong ways of applying accessibility to a SwiftUI app.

Download iOS app from the AppStore.

Read the blog post, Announcing the iOS SwiftUI Accessibility Techniques Open Source Project.

Review the project source code to see how to apply the accessibility techniques in working SwiftUI code examples.

Documentation files for each technique are listed below.

Topics

Contributor Guide

  1. Before contributing to this CVS Health sponsored project, you will need to sign the associated Contributor License Agreement.
  2. See contributing page.

License

iOS SwiftUI Accessibility Techniques is licensed under under the Apache License, Version 2.0. See LICENSE file for more information.

Copyright 2023-2024 CVS Health and/or one of its affiliates

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

ios-swiftui-accessibility-techniques's People

Contributors

padam2k avatar pauljadam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-swiftui-accessibility-techniques's Issues

.accessibilityHeadingLevel and VoiceOver support

Earlier today, I came across a question about heading level support on iOS in the #native-mobile channel on web-a11y.slack.com.

In the thread, "Genevieve" says

I just tested adding iOS heading levels in swift app and VO announced them. Fantastic! I didn't know we had this available

If this heading level VoiceOver support can be reproduced, I propose the following updates:

  • Update Headings markdown documentation to reflect that .accessibilityHeadingLevel is now supported by VoiceOver
  • Update Headings technique to include good/bad example of implementing heading levels

Error Validation: use .accessibilityValue matching the visible error message text for each invalid input

IMO, .accessibilityValue is another valid technique to expose an input's helper text and error message. Unlike .accessibilityHint, I don't think users can disable the announcement of an element's .accessibilityValue. This is why I think using .accessibilityValue may be a more robust approach.

My recommendation is to update the Error Validation coding technique (and associated documentation page) to include a "good" example that demonstrates how to use .accessibilityValue.

Add explainer on accessibility testing using XCTest

There are fantastic examples in this repo of using XCTest to perform accessibility related UI tests. I think it would be helpful to provide an overview in a separate markdown file that people can read before diving in to get a high level understanding of this topic.

This explainer could cover things like:

  • types of issues can you check for: missing labels for elements, lack of support for Dynamic Type, asserting existence of specific semantic accessibility properties/modifiers, etc.
  • key APIs used when writing tests
  • related resources like the following WWDC video: https://developer.apple.com/videos/play/wwdc2023/10035/

Documentation files do not link to associated coding technique

I noticed that the "Error Validation" documentation file does not contain a link to the associated coding technique. I think providing a link in the documentation file would make the relevant code easier to discover and navigate to. If others agree, I could help update the documentation files accordingly. Thanks!

Accessibility Hints on Data Table rows

The data tables documentation is awesome! The only thing I hesitate on is the use of an .accessibilityHint to convey row/column information. The only reason I say that is because there are still users who choose to have hints turned off.

The feedback I have gotten from VoiceOver users is to include the association of header and row within the label for each item.
That way whether hints are turn on/off it is conveyed. Now this does cause other potential issues such as overriding the text of the item in the cell or labels being super long.

Just as a note, I do not condone having the label say "Row " or "Column <xyz". Same as what you got documented :)

Accordions, HEADING role.

Just like in web we expect accordions to have heading role. For disclosure group, we can achieve this by .accessibilityElement(children: .contain)
and then .accessibilityLabel("The disclosure group text").

This will add the heading role, to the disclosure group.

Tab Bar - Badges.

I think having badges example in tabitem would add some good value. As, most homepages that will use tab bar will use the badges to indicate notifications or new information/updates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.