0

In a project I'm working on, I record usage metrics for various features, and I want to also track how often the features are used in accessibility mode. To that effect, I intend to use the UIAccessibilityIsVoiceOverRunning() function.

What I don't have a handle on, nor is it specified in the documentation, is whether calling this multiple times from multiple places will have an adverse impact on the overall latency of my app. There are a lot of metrics I'd like to add this to, so I worry about the combined effect of such a change. Any ideas?

RuslanD
  • 295
  • 3
  • 12
  • Looks similar to http://stackoverflow.com/questions/40117792/is-uiaccessibilityisvoiceoverrunning-an-expensive-call-to-make – Justin Oct 19 '16 at 18:19
  • It looks like we created our questions within minutes of each other. I had already started typing when the other question was posted :) – RuslanD Oct 21 '16 at 00:20

1 Answers1

2

Before answering, I need to caution:

  1. Be careful not to prematurely optimize; there may be no problem here.
  2. Consider whether you really want that answer to this question. Absolute user numbers for a particular product seldom bolster the case for accessibility. Supporting access is a moral, and sometimes legal, obligation and is not always supported by easily tabulated business metrics.
  3. There is more than one "accessibility mode" on iOS. Measuring VoiceOver use, alone, overlooks many other accessibility tools, and their users, including Dynamic Type, Switch Control, Touch Accommodations, and others.

That said, if by some coincidence UIAccessibilityIsVoiceOverRunning() is too expensive for your particular use case, you could register for VoiceOver status change notifications using UIAccessibilityVoiceOverStatusChanged and cache the value, yourself.

Justin
  • 20,509
  • 6
  • 47
  • 58
  • Hi Justin, thank you for your answer! I made no statement to the effect that I was going to use these metrics to justify investing in accessibility, nor that VoiceOver was the only accessible technology I was tracking. I merely tried to keep the question as focused as possible. Caching the VoiceOver status using the notification seems like a good alternative, but if I understand correctly, you don't know whether or not the call is expensive OTOH. – RuslanD Oct 21 '16 at 22:25
  • @RuslanD I have every reason to believe that it's a very fast and trivial call– I've never had a problem with its performance. I assume you're doing this for good reason, but I add context and cautions in case others stumble upon the answer looking for something else. – Justin Oct 22 '16 at 21:00