objective-cmacoscocoaswiftnssplitview

How to disable accessibility support for the divider of a NSSplitView?


I have a NSSplitView in my app. Its divider position is fixed, the user is not able to drag the divider around. Now I am adding support for accessibility. When using VoiceOver, the user can select & drag the divider. That breaks my UI. How can I tell VoiceOver, that it should ignore the divider?

I am using the new Accessibility Protocol available since OS X 10.10.

Setting splitView.isAccessibilityElement or splitView.isAccessibilityEnabled to no does not work.

Thanks for your help!


Solution

  • Ok, I asked a nice guy from the AppKit team at WWDC. He told me that this is not possible at the moment - because I can not acces the divider within the splitView.

    Explanation: Disabling the accessibility support on a NSView, makes the particular view inaccessible, but not its sub view - which is the desired behavior normally

    Since the divider is a subview of NSSplitView, this does not work.

    Solution: I ended up not using NSSplitView anymore because I don't need any of the class specific features. The dividers are fixed in my application.

    Instead I used NSStackView to encapsulate my subviews - and it works perfectly. (Hide and show subviews)