Add Narration Instead of VoiceOver

I am working on an app that will use recorded narration. Is there a way to prevent VoiceOver from reading the UILabel so that it doesn't speak over the narration audio when it becomes focused?

The app uses a class that extends UILabel to listen for accessibilityDidBecomeFocused, and accessibilityDidLoseFocus to start and stop an AVAudioPlayer.

Unfortunately, VoiceOver talks over this narration, which is obviously less than idea. Any help would be very much appreciated!
Answered by Blau Magier in 652681022
I was able to figure this out on my own. Adding the following code to my class that extends UILabel did the trick:

Code Block swift
override var accessibilityContainerType: UIAccessibilityContainerType {
        get { return .semanticGroup }
        set { }
    }
    
    override var accessibilityLabel: String? {
        get { return "" }
        set { }
    }
    
    override var accessibilityHint: String? {
        get { return "" }
        set { }
    }


Accepted Answer
I was able to figure this out on my own. Adding the following code to my class that extends UILabel did the trick:

Code Block swift
override var accessibilityContainerType: UIAccessibilityContainerType {
        get { return .semanticGroup }
        set { }
    }
    
    override var accessibilityLabel: String? {
        get { return "" }
        set { }
    }
    
    override var accessibilityHint: String? {
        get { return "" }
        set { }
    }


Add Narration Instead of VoiceOver
 
 
Q