fixed bug

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-09-07 09:59:00 -05:00
parent 520eec8b8d
commit cb8cde57f4

View File

@ -236,7 +236,23 @@ public class BaseViewController<Component: UIView>: 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 {