Currently, it doesn't seem that there is any compatibility for VoiceOver.
I've played with adding these lines into PKHUD, but that's not enough (or always the right) context for each PKHUD type.
I've also tried setting the label for each Content View type in HUD, but then the UIAccessibilityPostNotification(...) doesn't work when trying to set the focus on the container.
fileprivate extension UIView {
fileprivate func setAccessibilityProperties(for content: HUDContentType) {
self.accessibilityLabel = "Please wait."
switch content {
case .success:
self.accessibilityLabel = "Success!"
case .error:
self.accessibilityLabel = "Error!"
case .image(_),
.rotatingImage(_):
self.accessibilityLabel = "Image"
case .label(let title):
guard let label = title else { break }
self.accessibilityLabel = label
case .labeledSuccess(let title, let subtitle),
.labeledError(let title, let subtitle),
.labeledProgress(let title, let subtitle),
.labeledImage(_, let title, let subtitle),
.labeledRotatingImage(_, let title, let subtitle):
guard title != nil || subtitle != nil else { break }
self.accessibilityLabel = (title ?? "") + "\n" + (subtitle ?? "")
default:
self.accessibilityLabel = "In progress, please wait."
}
}
}
Currently, it doesn't seem that there is any compatibility for VoiceOver. I've played with adding these lines into
PKHUD
, but that's not enough (or always the right) context for each PKHUD type.I've also tried setting the label for each Content View type in
HUD
, but then theUIAccessibilityPostNotification(...)
doesn't work when trying to set the focus on the container.Suggestions?