Added accessibility support to in-app notifications on the ContentViewModel view model in the Sample app.

This commit is contained in:
2026-07-05 13:06:43 +02:00
parent 6373fad0cd
commit 6bcb88c944
4 changed files with 50 additions and 33 deletions
+24
View File
@@ -47,3 +47,27 @@ extension AppNotification {
case started
}
}
// MARK: - Properties
extension AppNotification {
/// The system symbol of the icon matching the notification's event.
var imageSymbol: String {
switch event {
case .cancelled: "xmark.circle"
case .failed: "exclamationmark.triangle"
case .started: "arrow.down.circle"
}
}
/// The localized message of the notification, naming the locale of the speech model, from the app's string catalog.
var textMessage: LocalizedStringResource {
switch event {
case .cancelled: .viewRecordingNotificationDownloadCancelled(localeName)
case .failed: .viewRecordingNotificationDownloadFailed(localeName)
case .started: .viewRecordingNotificationDownloadStarted(localeName)
}
}
}