diff --git a/content/notes/wwdc22/10151.md b/content/notes/wwdc22/10151.md index 599b3b3a..05b2cf34 100644 --- a/content/notes/wwdc22/10151.md +++ b/content/notes/wwdc22/10151.md @@ -10,10 +10,14 @@ https://github.com/apple/unityplugins ## Accessibility Elements In this demo, cards can be flipped by tapping the button. However, VoiceOver would not read the text on the screen and an external switch would not tap the button. +![Example-Card-Game][0] +[0]: ../../../images/notes/wwdc22/10151/0.jpg The text, cards, and button need to be accessibility elements so the user can understand what is on the screen. +![Elements][1] +[1]: ../../../images/notes/wwdc22/10151/1.JPG If the app supports multiple languages, the labels should also be localized. @@ -22,7 +26,9 @@ With the labels added as accessibility elements, VoiceOver would now be able to By adding an accessibility trait, VoiceOver would read the button as "Flip Button" and an external switch would be able to control the button. -![trait](https://github.com/WWDCNotes/Content/assets/88257761/1f18d74e-7baa-4be9-92a3-59e9ac4c4a64) +![Elements][2] + +[2]: ../../../images/notes/wwdc22/10151/2.JPG There are many different types of traits, full list can be found here: @@ -31,6 +37,10 @@ https://developer.apple.com/documentation/uikit/uiaccessibilitytraits In this example, the cards would need a `value` trait to be able to provide the face value of the cards. +![Value][3] + +[3]: ../../../images/notes/wwdc22/10151/3.JPG + ### Unity Implementation Accessibility elements are added using the `Accessibility Node` component. This component is added to any gameObject that the user wishes to add accessibility for. The script provides the following fields: @@ -40,7 +50,9 @@ Accessibility elements are added using the `Accessibility Node` component. This - Hint - Identifier +![Script][4] +[4]: ../../../images/notes/wwdc22/10151/4.JPG Buttons in Unity UI already have the `Accessibility Node` component by default. Creating custom C# scripts using Apple's Accessibility requires `using Apple.Accessibility` @@ -98,7 +110,12 @@ In a similar way, the face of the cards could also be modified during these acce LargeMaterial; } ``` +![Value][5] + +[5]: ../../../images/notes/wwdc22/10151/5.JPG +![Value][6] +[6]: ../../../images/notes/wwdc22/10151/6.JPG ## UI Accommodations ### Reduce Transparency @@ -106,11 +123,19 @@ In a similar way, the face of the cards could also be modified during these acce - Helps improve legibility - Can be checked with `AccessibilitySettings.IsReduceTransparencyEnabled` +![Reduce-Transparency][8] + +[8]: ../../../images/notes/wwdc22/10151/8.jpg + ### Increase Contrast - Colors stand out more - Makes controls easier to recognize - Can be checked with `AccessibilitySettings.IsIncreaseContrastEnabled` +![Increase-Contrast][7] + +[7]: ../../../images/notes/wwdc22/10151/9.jpg + ### Reduce Motion - Animations should be removed if this is enabled - Can be checked with `AccessibilitySettings.IsReduceMotionEnabled`