accessibilitySpeechPitch lets you emphasise something changing VoiceOver's pitch. The value goes from 0.0 to 2.0. The default is 1.0. Twitter could change pitch to read hashtags, for example, avoiding repetition but still signalling they're there.

Example shows how you can specify changing the pitch for a portion of an attributed accessibility label, using the accessibilitySpeechPitch attribute, for hashtags on a tweet. By default VoiceOver would read something like “Writing about developing accessible hashtag iOS apps in hashtag 365 days iOS Accessibility hashtag accessibility hashtag a 11 y”. There’s lots of repetition of the word hashtag. But it could be changed so it says “Writing about developing accessible iOS apps in 365 days iOS Accessibility accessibility a 11 y” where iOS, 365 days iOS accessibility, accessibility and a 11 y, is read with a lower pitch of 0.7.

You may also find interesting...

Tip for abbreviations. Something like "3h 24m" will be read by VoiceOver as "3 h 24 meters". Formatters can help. DateComponentsFormatter with a "spellOut" units style will give you a more suitable label: "three hours, twenty-four minutes" Example code in the image: ```swift let dailyAverageLabel = UILabel() let abbreviatedReadableFormatter = DateComponentsFormatter() abbreviatedReadableFormatter.allowedUnits = [.hour, .minute] abbreviatedReadableFormatter.unitsStyle = .spellOut let abbreviatedReadableDuration = abbreviatedReadableFormatter.string(from: 12240) dailyAverageLabel.accessibilityLabel = abbreviatedReadableDuration ``` Some useful links: * Date Components Formatter: * Units Style: By the way! Formatters are also great for localisation.

UINotificationFeedbackGenerator has a “success” feedback type. Consider using it when a task was performed successfully together with any other visuals or sound. The use of multiple modes just makes it easier for everyone to understand your app.

To capture the gesture, you can override the accessibilityPerformEscape() function. In there you can dismiss your view, and return true if you could successfully handle it. https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilityperformescape()

Created in Swift with Ignite.

Supporting Swift for Swifts