Update PosterButton.swift | Adding accessibility support to media posters in media section of TVOS app (#1153)

* Update PosterButton.swift

Added accessibility labels to enable voice over on TVOS to read film titles on posters in media.

* lint

---------

Co-authored-by: Ethan Pippin <ethanpippin2343@gmail.com>
This commit is contained in:
Peter Hamilton 2024-10-09 00:07:59 +01:00 committed by GitHub
parent b44ad7994f
commit c5d6539018
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,6 +76,7 @@ struct PosterButton<Item: Poster>: View {
onFocusChanged(newValue)
}
}
.accessibilityLabel(item.displayTitle)
content()
.eraseToAnyView()
@ -142,6 +143,7 @@ extension PosterButton {
Text(item.displayTitle)
.font(.footnote.weight(.regular))
.foregroundColor(.primary)
.accessibilityLabel(item.displayTitle)
}
}