Bronze challenge - not getting anywhere

Did anyone ever figure this out? I’ve been poking at it all evening & getting nowhere.

I’m trying to set the accessibilityLabel of the navigation controller in PhotosViewController to something completely different (just to make sure I’m having some effect):

    override func viewDidLoad()
        navigationController?.accessibilityLabel = "Live"

but it doesn’t change anything, the inspector still speaks “Photorama”. Overriding the accessibilityLabel of PhotosViewController itself doesn’t do anything either. Changing the accessibilityLabel of collectionView modifies what gets spoken if you touch inside the view but not on any photo, but has no effect on the header at the top.

I’m not seeing any accessibility options for the navigation controller in the storyboard that I can modify (like we did with PhotoInfoViewController) either. And modifying the accessibilityAttributedLabels to provide a IPA pronunciation doesn’t work either (more on that here).

The only thing I didn’t try was overiding the accessibilityLabel of UINavigationController instead of just setting it. That would require creating a class that inherits from UINavigationController and changing PhotosViewController to use it, which seems like overkill just to tweak a pronunciation that IMO doesn’t really need any help. Maybe iOS has a harder time with the word “Photorama” but in the simulator on the Mac it sounds just fine to me.

OK, somewhere I overlooked something, because when I went back and tried again to set accessibilityLabel in PhotosViewController, it worked:

class PhotosViewController: UIViewController, UICollectionViewDelegate {


    override func viewDidLoad()

        accessibilityLabel = "Live"

However, I can’t seem to use accessibilityAttributedLabel to change the way it pronounces “Live”, I always get the short “i” even with this code added to viewDidLoad:

        let attributedString = NSMutableAttributedString(string: "Live")
        let range = attributedString.string.range(of: "Live")
        attributedString.addAttributes([.accessibilitySpeechIPANotation: "līv"], range: NSRange(range!, in: attributedString.string))
        accessibilityAttributedLabel = attributedString

I also tried this shorter version (with a slightly different IPA notation) without success:

        accessibilityAttributedLabel = NSAttributedString(string: "Live",
                                                          attributes: [.accessibilitySpeechIPANotation: "laɪv"])

And if I remove the line that sets accessibilityLabel (so only accessibilityAttributedLabel is set) it goes back to saying “Photorama”. Setting accessibilityLabel to an empty string stops it from saying anything.

So I figured out how to change what it says when I select the “Photorama” heading at the top of the screen, but I can’t use the attributed label to influence the way it pronounces it, so I still haven’t completed the challenge.

It looks like this may be a limitation of the Accessibility Inspector. If I set accessibilityLabel, accessibilityAttributedLabel and the IPA notation to three different words, the Accessibility Inspector seems to only see what’s in accessibilityLabel. Apparently I’ll need to run on a real device with VoiceOver to get the specified pronunciation in the Attributed label.