Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception when pausing voice over

Tags:

ios

swift3

I try to pause voice over and get an exception:

UIAccessibilityPostNotification(UIAccessibilityPauseAssistiveTechnologyNotification, UIAccessibilityNotificationVoiceOverIdentifier)

'NSInvalidArgumentException', reason: 'You must pass the identifier of the assistive technology to pause. See UIAccessibilityConstants.h for the list of valid values.'

What's wrong? Thanks!

like image 256
Jan F. Avatar asked Jan 02 '17 16:01

Jan F.


1 Answers

I too ran into this issue and despite the voice over identifier is marked being available since ios9 it still continues to crash on ios10. After looking into the documentation made me think that the 'pause / resume assistive technology' is not meant for voice over after all.

"Should be posted to pause an assistive technology's operations temporarily. For example, you may want to pause scanning in Switch Control while your app plays an animation. An identifier representing the assistive technology should be used as the argument. Currently, these notifications only apply to Switch Control. The notifications must be balanced. That is, every UIAccessibilityPauseAssistiveTechnologyNotification should be followed by a matching UIAccessibilityResumeAssistiveTechnologyNotification with the same argument. If the user performs an action that requires the assistive technology to resume operations, it may do so before it receives the corresponding UIAccessibilityResumeAssistiveTechnologyNotification. The argument is a NSString."

like image 60
nsuinteger Avatar answered Oct 16 '22 22:10

nsuinteger