1

I'm trying to make my app more accessible for customers who are blind or low-vision. To minimize unnecessary information I am trying to remove VoiceOver for decorative images. In the following example VoiceOver reads "clock.arrow.circlepath"; which is maybe not very helpful.

For images it is possible to disable VoiceOver by using

Image(decorative: "image")

How can I do this for a system image (an SF Symbol)?

HStack {
    Image(systemName: "clock.arrow.circlepath")
        .frame(width: 30, height: 30)
        .foregroundColor(.orange)
        .padding(.trailing)
    Text(LocalizedStringKey(stringLiteral: "DeleteHistory"))
    Spacer()
}
Sam Spencer
  • 8,492
  • 12
  • 76
  • 133
Michael
  • 616
  • 5
  • 20

1 Answers1

0

The possible solution is to hide accessibility element, like

    Image(systemName: "clock.arrow.circlepath")
        .accessibility(hidden: true)

Tested with Xcode 13beta / iOS15

Asperi
  • 228,894
  • 20
  • 464
  • 690
  • Thank you Asperi, this works. I knew there has to be an easy solution. The decorative parameter leads me to the wrong way :-) – Michael Jun 24 '21 at 08:37