-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a11y for interop views #1241
Conversation
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface CMPInteropWrappingView : UIView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, One thing to think about:
Creating new subclass of UIView
/ UIAccessibilityElement
for every new use-case (which is now) VS create one subclass of UIView, one of UIAccessibilityElement with all default implementations of necessary methods from Accessibility protocols.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole point of this is to make the UIAccessibility methods be visible to Kotlin in the first place. Cinterop doesn't see some of them because they are declared in a category and struggles to do overriding because of duality of property and selectors in ObjC which is not the case for fields and methods in Kotlin. Keeping it in ObjC and avoiding presence of subclasses in Kotlin altogether would require adding a lot of code to ObjC to map the values and types from compose core. Thus I find the current solution the most optimal trade-off.
Proposed Changes
Make the native views created using
UIKitView
andUIKitViewController
reachable by AX services.Testing
Test: NativeModalWithNavigation cats images are interop views reachable by using the VoiceOver controls.
Issues fixed
Fixes: JetBrains/compose-multiplatform#4290
Example
UIImageView
focused by using the VoiceOver controls