add custom rotors

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-02 14:52:31 -05:00
parent d3236876b1
commit 539ecf78a7

View File

@ -252,8 +252,16 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable ,
NotificationCenter.default.publisher(for: UIAccessibility.voiceOverStatusDidChangeNotification).sink { [weak self] _ in
if UIAccessibility.isVoiceOverRunning {
if let component = self?.component {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self?.loadCustomRotors()
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
guard let self else { return }
loadCustomRotors()
if let rotors = component.accessibilityCustomRotors {
if var accessibilityCustomRotors {
accessibilityCustomRotors.append(contentsOf: rotors)
} else {
accessibilityCustomRotors = rotors
}
}
UIAccessibility.post(notification: .screenChanged, argument: component)
}
}