Why is UIAccessibility.post(notification: .announcement, argument: “arg”) not announced in voice over?

前端 未结 4 2264
温柔的废话
温柔的废话 2021-02-14 20:34

When using Voice Over in iOS, calling UIAccessibility.post(notification:argument:) to announce a field error doesn\'t actually announce the error.

I have a

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-14 20:58

    Your problem may happen because the system needs to take over during the field error appears and, in this case, any customed VoiceOver notification is cancelled.

    I wrote an answer about problems with queueing multiple VoiceOver notifications that may help you to understand your current situation.

    Your notification works with a breakpoint because you're delaying it and the system works during this time : there's no overlap between your notification and the system work.

    A simple solution may be to implement a short delay before sending your notification.

    Your retry mechanism is smart and could be improved inside a loop of few retries in case of many system takeovers.

提交回复
热议问题