I would liked to post a queued announcement
I tried using UIAccessibilitySpeechAttributeQueueAnnouncement but I have trouble converting it into an NSAttributedStringKey
Code:
let queueAnnouncementKey = NSAttributedStringKey(rawValue: UIAccessibilitySpeechAttributeQueueAnnouncement)
let announcementString = NSAttributedString(string: "something",
attributes: [queueAnnouncementKey : NSNumber(booleanLiteral: true)])
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, announcementString)
Problem:
- The announcement is not queued, if there is an on going announcement at that moment, it ignores my announcement
Possible Cause:
I think something the way I create
NSAttributedStringis wrongI think the
NSAttributedStringhas changed from the time this presentation was made, so needed to use rawValue.May be it is because it is not the correct raw value and that is causing it not to work.
Refer:
https://developer.apple.com/videos/play/wwdc2017-215/?time=1627