ensure voiceover is running
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d54a1d4b02
commit
8f3f5ae843
@ -107,10 +107,18 @@ open class Loader: View {
|
|||||||
rotation.duration = 0.5
|
rotation.duration = 0.5
|
||||||
rotation.repeatCount = .infinity
|
rotation.repeatCount = .infinity
|
||||||
icon.layer.add(rotation, forKey: rotationLayerName)
|
icon.layer.add(rotation, forKey: rotationLayerName)
|
||||||
|
|
||||||
|
// check to make sure VoiceOver is running
|
||||||
|
guard UIAccessibility.isVoiceOverRunning else {
|
||||||
|
loadingTimer?.invalidate()
|
||||||
|
loadingTimer = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Focus VoiceOver on this view
|
// Focus VoiceOver on this view
|
||||||
UIAccessibility.post(notification: .layoutChanged, argument: self)
|
UIAccessibility.post(notification: .layoutChanged, argument: self)
|
||||||
|
|
||||||
|
// setup timer for post
|
||||||
loadingTimer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in
|
loadingTimer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in
|
||||||
self?.accessibilityLabel = "Still Loading"
|
self?.accessibilityLabel = "Still Loading"
|
||||||
UIAccessibility.post(notification: .announcement, argument: "Still Loading")
|
UIAccessibility.post(notification: .announcement, argument: "Still Loading")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user