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...

Accessibility labels should not contain the type of the control, that's a job for the accessibility trait instead. If you have a button with a label like "Close button" and the ".button" trait, VoiceOver will say: "Close button, button".

Configuring the header accessibility trait, when appropriate, is one of my favourite accessibility quick wins. In this example, you need a single swipe down, instead of 12 swipes to the right to get to from Podcasts to Artists, in the app.

All the accessibility capabilities you can check for, have counterpart notification names you can observe in case the user changes its preferences while using your app. https://x.com/dadederk/status/1577435144129892352

Created in Swift with Ignite.

Supporting Swift for Swifts