accessibilityActivate() lets you capture a VoiceOver double tap. This is useful if you are creating a custom component you interact with using complex gestures or VoiceOver navigation gestures. An example: slide to unlock.

https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilityactivate()

The classic Slide to Unlock component used in iOS for unlocking your device, in the first iOS versions, required sliding a button with an arrow to the right. This clashed with a flick to the right gesture used with VoiceOver to navigate to the next item. It would try to find the next element on screen instead of unlocking the device and it would play a sound indicating you’ve reached the end of the screen. So you could double tap to activate instead. This can be achieved by overriding accessibilityActivate() in the slide to unlock component.

You may also find interesting...

When presenting a UI component that overlays the existing UI, you may have found that VoiceOver starts to randomly jump between the overlaid UI and the elements underneath. To avoid that, you can set its accessibilityViewIsModal to true. When setting the accessibilityViewIsModal to true for a view, VoiceOver will ignore its sibling views, treating it as if it was a modal. Useful when presenting custom popups, popovers, modals, action sheets, etc. https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilityviewismodal

Toggles or UISwitches are often found separated from the label that precedes (and describes) them; with an unclear label; missing a value, trait, or hint; or even not being actionable at all.

It is not just about applying accessibility APIs, but about caring, and thinking of features that can make your app more accessible and inclusive to everyone. Twitter's alt-text feature is a great example. Thanks, @TwitterA11y! You'll be missed.

Created in Swift with Ignite.

Supporting Swift for Swifts