From 539ecf78a7bb4e53954b918a10d58aa5324d6094 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 2 Jul 2024 14:52:31 -0500 Subject: [PATCH] add custom rotors Signed-off-by: Matt Bruce --- VDSSample/ViewControllers/BaseViewController.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/VDSSample/ViewControllers/BaseViewController.swift b/VDSSample/ViewControllers/BaseViewController.swift index 6048bac..3fb217d 100644 --- a/VDSSample/ViewControllers/BaseViewController.swift +++ b/VDSSample/ViewControllers/BaseViewController.swift @@ -252,8 +252,16 @@ public class BaseViewController: 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) } }