UIAccessibilityScreenChangedNotification not working when using largest dynamic font

I met this problem recently. Basically, I want the voice-over back to the first element ( the bar item ) when the alert is dismissed.

I had tried passing the bar item

UIAlertAction *okAction = [UIAlertAction actionWithTitle: @"OK"                               style:UIAlertActionStyleCancel                              handler:^(UIAlertAction *action) {       dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{         UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.navigationItem.leftBarButtonItem);       });     }];

I also tried passing nil to UIAccessibilityScreenChangedNotification. I also tried setting accessibility elements in this controller or in the view in the controller. But none of the above works.

When I tested it on iPhone Xr (iOS 15), there was no problem. But it's not working on iPhone 8 Plus (iOS 14). The issue with iPhone 8 Plus (iOS 14) is that the voice-over just randomly focuses on some element on the view.

I was searching in docs, forums and websites but could not really find any help. Maybe someone has made the same experience and could share the solution with me.

Thank you in advance!

Glad to hear this is working on iOS 15, it sounds like perhaps there was a bug in iOS 14 that we have fixed.

Passing in the bar item won't work because it's not a view. If you pass in a container view though, we'll try to focus on the first element inside of it. So if you pass in the entire navigation bar or any sort of container that you do have access to in the view hierarchy, we should focus on that. You might need to do some view hierarchy traversing to get what you need. But you should be able to pass in nil and get the right behavior, which is what you are seeing on iOS 15

UIAccessibilityScreenChangedNotification not working when using largest dynamic font
 
 
Q