Skip to main content
Home

Main navigation

  • Apps
  • Forum
  • Blog
    • Podcast
    • Guides
    • Hardware & Accessory Reviews
    • Bug Tracker
    • Developer Resources
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. App Development and Programming

How to play a Voiceover notification when signal lost (i.e., no user interaction)?

By Mane, 27 February, 2018

Forum
App Development and Programming

I've built a simple audio streaming app. When I lose the audio stream connection, my app overlays a grayed screen on top of the UI.

I want to make the app accessible to folks who are blind or have low vision, so I want Voiceover to speak "Signal lost" and "Reconnecting" when the signal is lost and that overlay screen appears. This all has to happen without any user interaction (akin to what happens when the screen times out, and VO says, 'screen dimmed'). It would be nice for VO to speak, "Signal regained" upon reconnection, too, but not absolutely necessary.

To make it even more tricky, when the 'signal lost' screen is up, the user should *not* be able to manipulate any of the other fields in the main UI below.

How do I accomplish this?

Thanks in advance for all your help!

Options

  • Log in or register to post comments

Comments

Lost Signal

By Weather Gods (Scott)

5 years ago

Hi,

You can post a notification when the signal is lost :
https://developer.apple.com/documentation/uikit/1615194-uiaccessibilitypostnotification

You can disable field / buttons from being accessible by voiceover by just setting them to hidden.

HTH
Scott

Hidden

By Mane

5 years ago

In reply to Lost Signal by Weather Gods (Scott)

Thanks, Scott! the notification works great.

Re: hiding the accessibility elements, I set accessibilityElementsHidden=true in my TableView when the overlay is displayed, but I'm still able to swipe among those elements in the main UI underneath the overlay. I suspect the overlay subview is not the focused view. How do I programmatically shift focus to the overlay?

Hidden

By Weather Gods (Scott)

5 years ago

Yes, you will get this problem with an overlay. Try setting the view beneath to hidden from accessibility. That way it should hide all the child accessibility elements as well. I tend to have a single function that will hide or show everything in the view - just pass a boolean 'isHidden' and call accessibilityElementsHidden=isHidden

I get the same problem with my app from time to time, even after I've hidden everything, they sometimes still show through.

Hidden Resolution

By Mane

5 years ago

In reply to Hidden by Weather Gods (Scott)

I was able to achieve the desired behavior by BOTH:
- setting accessibilityElementsHidden to TRUE within the main UIView, and
- notifying the app that the screen has changed by calling UIAccessibilityPostNotification with the UIAccessibilityScreenChangedNotification notification.
Now when my overlay appears, I hear a 'bloop' telling me the focus has changed, and none of the accessible elements from the main UIView show through

More Like This

Site Information

  • About
  • Club AppleVis
  • FAQ
  • Contact

Unless stated otherwise, all content is copyright AppleVis. All rights reserved. © 2023 | Accessibility | Terms | Privacy