{"id":128359,"date":"2021-06-10T13:00:43","date_gmt":"2021-06-10T13:00:43","guid":{"rendered":"https:\/\/developer.apple.com\/news\/?id=4dcwl3iv"},"modified":"2021-06-10T13:00:43","modified_gmt":"2021-06-10T13:00:43","slug":"challenge-voice-control-synonyms","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2021\/06\/10\/challenge-voice-control-synonyms\/","title":{"rendered":"Challenge: Voice Control Synonyms"},"content":{"rendered":"<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/09\/challenge-voice-control-synonyms.jpg\" data-hires=\"false\" alt=\"Icon of speech bubble with question mark in it on purple background\"><\/div>\n<p>Challenge yourself to make your app accessible through Voice Control and provide support for voice-based interaction. Voice Control is a feature built into iOS, iPadOS, and macOS, and empowers those who can\u2019t use traditional input devices to control their Mac, iPhone, and iPad entirely with their voices. For people with motor limitations, having full voice control of their devices is truly transformative. People can gesture with their voices to click, swipe, and tap anywhere \u2014 they can do everything someone could do with a mouse or with touch. On iOS and iPadOS, Voice Control has the additional option to show Item Names, which place a name next to each tappable item. In this challenge, we\u2019ll be making the \u201cShow Names\u201d experience better.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/09\/challenge-voice-control-synonyms-1.jpg\" data-hires=\"false\" alt=\"Voice Control in Podcasts on iOS: \u201cShow names.\u201d\"><\/div>\n<p>Suppose that you create a button that looks like a paper airplane. What do you say to tap? \u201cTap send\u201d? \u201cTap reply\u201d? \u201cTap airplane\u201d? In UIKit you can use the accessibilityUserInputLabels string array to respond to these prompts, while in SwiftUI you\u2019d use the .accessibilityInputLabels modifier.<\/p>\n<h3>How to enable Voice Control<\/h3>\n<p>To use Voice Control, go to <strong>Settings &gt; Accessibility &gt; Voice Control<\/strong>. If it\u2019s your first time enabling this setting, you&#8217;ll be asked to <strong>Set Up Voice Control<\/strong> and download a short file.<\/p>\n<p>Once Voice Control has been set up, you can enable it in a few different ways:<\/p>\n<ul>\n<li>You can ask Siri to turn Voice Control on or off for you at anytime. <\/li>\n<li>You can use the Accessibility Shortcut in <strong>Settings &gt; Accessibility<\/strong> and set the shortcut to <strong>Voice Control<\/strong>. Now, when you triple click the side button (or Home button, depending on your device), you can quickly turn <strong>Voice Control<\/strong> on or off.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/support.apple.com\/guide\/iphone\/voice-control-iph2c21a3c88\/ios\" class=\"icon icon-after icon-chevronright\">Use Voice Control to interact with iPhone<\/a><\/p>\n<h3>Begin the challenge<\/h3>\n<p>We\u2019re challenging you to make your app\u2019s UI as easy to navigate by voice as possible and improve the Voice Control experience in your app. Start by turning on Voice Control by visiting <strong>Settings &gt; Accessibility &gt; Voice Control<\/strong>, and enable <strong>Overlay &gt; Show Names<\/strong>.<\/p>\n<p>Next, take a screenshot of your interface with the \u201cShow names\u201d overlay displaying on top of it. Explore what it\u2019s like to navigate your app by Voice Control alone. What experience are you giving people right now? Are you struggling with any common tasks? How could you make it better?<\/p>\n<p>Once you\u2019ve spent some time with your app in Voice Control mode, it\u2019s time to make some improvements. Here are a few tweaks you can make to your code to make your experience better for everyone.<\/p>\n<p><strong>Explore accessibilityInputLabels<\/strong><br \/>\nFirst, you can implement <code>accessibilityInputLabels<\/code> to create short, concise labels that someone could easily speak by voice.<\/p>\n<pre class=\"code-source\"><code><span class=\"syntax-type\">Button<\/span>(action: { sendMessage <span class=\"syntax-operator\">=<\/span> <span class=\"syntax-literal\">true<\/span>\n}) { <span class=\"syntax-type\">Image<\/span>(systemName: <span class=\"syntax-string\">\"paperplane\"<\/span>) .font(.title) .accessibilityInputLabels([<span class=\"syntax-string\">\"send\"<\/span>, <span class=\"syntax-string\">\"reply\"<\/span>, <span class=\"syntax-string\">\"airplane\"<\/span>])\n}<\/code><\/pre>\n<p><strong>Tips:<\/strong><\/p>\n<ul>\n<li>Your primary string is the first string in the array, and will be the one that Voice Control shows on screen. <\/li>\n<li>Brevity is key: use short, succinct words.<\/li>\n<li>Localize your strings using NSLocalizedString and avoid special symbols in your labels.<\/li>\n<li>When it comes to number of synonyms, add them judiciously. Limit the number of possible strings to a max of 4, as to not overload the recognition system.<\/li>\n<\/ul>\n<p>You may have multiple elements in your UI that could be described the same way: One example is an image browser, where each image might be described as \u201cScreenshot\u201d. You can rely on Voice Control\u2019s disambiguation feature in these cases to keep your label names short. When someone says \u201cScreenshot\u201d, a list of numbers will appear over all elements named \u201cScreenshot\u201d for someone to choose from.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/09\/challenge-voice-control-synonyms-2.jpg\" data-hires=\"false\" alt=\"Two screenshots with voice control labels, showing Voice Control\u2019s disambiguation feature\"><\/div>\n<p><strong>Shorten label names<\/strong><br \/>\nIf your app already incorporates <code>accessibilityLabel<\/code>, you\u2019ve done a lot of the work already \u2014 but your labels may be too long to speak! You can take advantage of <code>accessibilityUserInputLabels<\/code> (or, in SwiftUI, <code>.accessibilityInputLabels<\/code>) to keep the speakable label short, while leaving the valuable information your current <code>accessibilityLabel<\/code> conveys to an audience that relies on it. <\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/09\/challenge-voice-control-synonyms-3.jpg\" data-hires=\"false\" alt=\"two views with voice control labels shown, comparing \u201cbirthday plans edited 4 days ago\u201d versus \u201cbirthday plans\u201d\"><\/div>\n<p><strong>Share your experiences<\/strong><br \/>\nAs you add support for Voice Control to your app, share your implementation with the developer community. After you\u2019ve made changes or improvements to your app, take another screenshot of your UI with the \u201cShow names\u201d overlay enabled. Share \u201cbefore\u201d and \u201cafter\u201d screenshots on the Developer Forums. (And don\u2019t forget to add alt text to your screenshot images on platforms that support it!)<\/p>\n<h3>Resources<\/h3>\n<p><a href=\"https:\/\/developer.apple.com\/forums\/\" class=\"icon icon-after icon-chevronright\">Visit the Apple Developer Forums<\/a><\/p>\n<p><a href=\"https:\/\/www.apple.com\/macos\/big-sur\/docs\/Voice_Control_Tech_Brief_Sept_2019.pdf\" class=\"icon icon-after icon-chevronright\">Voice Control<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/objectivec\/nsobject\/3197989-accessibilityuserinputlabels\" class=\"icon icon-after icon-chevronright\">accessibilityUserInputLabels<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/SwiftUI\/View\/accessibilityInputLabels(_:)-9q3yf\" class=\"icon icon-after icon-chevronright\">accessibilityInputLabels(_:)<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/wwdc21\/challenges\/terms\/WWDC21_Challenge_Terms_Conditions.pdf\" class=\"icon icon-after icon-chevronright\">Read the WWDC21 Challenges Terms and Conditions<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Challenge yourself to make your app accessible through Voice Control and provide support for voice-based interaction. Voice Control is a feature built into iOS, iPadOS, and macOS, and empowers those who can\u2019t use traditional input devices to control their Mac, iPhone, and iPad entirely with their voices. For people with motor limitations, having full voice [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":128360,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-128359","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apple-developer-news"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/128359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=128359"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/128359\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/128360"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=128359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=128359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=128359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}