Added accessibility support to in-app notifications on the ContentViewModel view model in the Sample app.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Accessibility
|
||||
import Foundation
|
||||
import Notifying
|
||||
import Observation
|
||||
import OSLog
|
||||
import Recording
|
||||
@@ -153,8 +153,8 @@ private extension ContentView.Model {
|
||||
await SpeechTranscriber.supportedLocale(equivalentTo: locale)
|
||||
}
|
||||
|
||||
/// Posts a notification for a download event of the given locale, scheduling its automatic dismissal a few seconds later —
|
||||
/// the only way a notification is dismissed.
|
||||
/// Posts a notification for a download event of the given locale, announcing it to assistive technologies and scheduling its
|
||||
/// automatic dismissal a few seconds later — the only way a notification is dismissed.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - event: The download event to notify.
|
||||
@@ -170,6 +170,10 @@ private extension ContentView.Model {
|
||||
|
||||
notifications.append(notification)
|
||||
|
||||
AccessibilityNotification.Announcement(
|
||||
String(localized: notification.textMessage)
|
||||
).post()
|
||||
|
||||
Task {
|
||||
try? await Task.sleep(for: Constant.Delay.dismissal)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user