Added accessibility support to in-app notifications on the ContentViewModel view model in the Sample app.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user