1

I have a simple image view. Which I don't want to be read by the accessibility clients. I tried the solution given here. However this solution didnt work. Also I have one limitation. I want to support OSX 10.9 Hence I cant use accessibilityElement Property provided by AppKit since its only available from 10.10

Please let me know a simple way to make certain elements inaccessible for voiceover clients.

Also I would to know the 10.9 equivalent of accessiblityElement.

Community
  • 1
  • 1
hcnimkar
  • 301
  • 2
  • 13

2 Answers2

1

Most methods in the NSAccessibility informal protocol were deprecated in 10.10 in favor of property-based accessibility configuration. Prior to 10.10, you would mark elements as accessible (or not) by overriding accessibilityIsIgnored().

Justin
  • 20,509
  • 6
  • 47
  • 58
0

In modern versions of macOS, you can use accessibilityElement for this. When seeking to hide an NSControl, though, it's important to use the control's cell to hide the element from all flavors of accessibility. (VoiceOver, Switch Control, Hover Text, etc.) So in the case of an NSImageView you would use:

myImageView.cell?.setAccessibilityElement(false)
Nick K9
  • 3,885
  • 1
  • 29
  • 62