Accessibility Issues with Custom VoiceOver Labels on macOS 14 for Prototyping a New Feature
After trying multiple solutions online, I still can't figure this out. I'm following best practices but I've been struggling with this for a few days now and could really use some help..... Currently developing a prototype feature aimed at improving accessibility in our latest macOS application... The goal is to implement custom VoiceOver labels for UI components to enhance the user's experience. Despite following Apple's guidelines, I've run into challenges getting VoiceOver to recognize and read the custom labels as expected. Here's a snippet of the code where I'm setting the labels: ```swift import Cocoa class CustomView: NSView { override func awakeFromNib() { super.awakeFromNib() let button = NSButton() button.setAccessibilityLabel("Submit Form") button.accessibilityDescription = "Click to submit your information" addSubview(button) } } ``` In this setup, I've confirmed that VoiceOver is enabled and running. However, it seems that VoiceOver is still defaulting to the standard label instead of the custom one. I’ve tried using `setAccessibilityValue()` alongside `setAccessibilityLabel()` for additional context, but that also hasn’t made a difference. After researching, I came across suggestions to implement `NSAccessibilityCustomAction` to enhance the VoiceOver experience, but I’m unsure if that’s the right approach for my case. I also experimented with various combinations of these methods, including setting the `accessibilityRole` to `NSAccessibilityRole.button`, yet VoiceOver behavior hasn’t improved. To further troubleshoot, I checked for conflicting accessibility attributes within the view hierarchy, and nothing stood out. My aim is to ensure that users relying on VoiceOver can easily navigate and understand the purpose of each button. Any insights on best practices for implementing custom VoiceOver labels or debugging this kind of issue on macOS 14 would be greatly appreciated, especially if there are known workarounds or alternative methods to explore. Thanks in advance for your help! My development environment is macOS. Thanks for any help you can provide! I've been using Swift for about a year now. Has anyone else encountered this? I'm coming from a different tech stack and learning Swift. Thanks for any help you can provide!