diff --git a/VDSSample/ViewControllers/BaseViewController.swift b/VDSSample/ViewControllers/BaseViewController.swift index 85534ba..dbe9d2f 100644 --- a/VDSSample/ViewControllers/BaseViewController.swift +++ b/VDSSample/ViewControllers/BaseViewController.swift @@ -236,7 +236,23 @@ public class BaseViewController: UIViewController, Initable , self?.activeTextField = nil }.store(in: &subscribers) - loadCustomRotors() + + 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() + UIAccessibility.post(notification: .screenChanged, argument: component) + } + } + } + }.store(in: &subscribers) + + // Initially register the custom rotor if VoiceOver is on + if UIAccessibility.isVoiceOverRunning { + loadCustomRotors() + UIAccessibility.post(notification: .screenChanged, argument: component) + } } func isViewHiddenByKeyboard(view: UIView, keyboardFrame: CGRect) -> Bool {