iOS: Add accessibility labels to toolbar buttons

This commit is contained in:
Shadowfacts 2020-09-30 18:10:36 -04:00
parent 89b226e321
commit 4f3e1432e7
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5

View File

@ -30,6 +30,7 @@ struct ToolBar: View {
Image(systemName: "arrow.left")
.font(.system(size: 24))
}
.accessibility(label: Text("Back"))
.contextMenu {
ForEach(Array(navigator.backStack.suffix(5).enumerated()), id: \.1) { (index, url) in
Button {
@ -47,6 +48,7 @@ struct ToolBar: View {
Image(systemName: "arrow.right")
.font(.system(size: 24))
}
.accessibility(label: Text("Forward"))
.contextMenu {
ForEach(navigator.forwardStack.prefix(5).enumerated().reversed(), id: \.1) { (index, url) in
Button {
@ -64,6 +66,7 @@ struct ToolBar: View {
Image(systemName: "arrow.clockwise")
.font(.system(size: 24))
}
.accessibility(label: Text("Reload"))
Spacer()
@ -71,6 +74,7 @@ struct ToolBar: View {
Image(systemName: "square.and.arrow.up")
.font(.system(size: 24))
}
.accessibility(label: Text("Share"))
Spacer()
@ -80,6 +84,7 @@ struct ToolBar: View {
Image(systemName: "gear")
.font(.system(size: 24))
})
.accessibility(label: Text("Preferences"))
}
Spacer()