wimagguc / ios-custom-alertview

Custom UIAlertView. Continue adding images and UIViews to dialogs in iOS7+
Other
1.66k stars 393 forks source link

VoiceOver support #102

Open rosano opened 8 years ago

rosano commented 8 years ago

I tried CustomIOS7AlertView (using now) and CustomIOSAlertView and in both cases the non-alert elements are accessible when I believe UIAlertController ensures that non-alert elements are not accessible via voiceover (you cannot touch or scroll to any elements outside the alert via voiceover). If you haven't tried VoiceOver before, you can ask Siri "Turn on VoiceOver" or turn it on in Settings > Accessibility > Voiceover; there is also a triple-tap home button shortcut you can enable in the same settings pane.

With CustomIOS7AlertView, the alert elements are mixed in with the other elements as you scroll through. With CustomIOSAlertView, the alert elements cannot be accessed by scrolling - interestingly you can tap alert elements directly to access them, and then you cannot access the non-alert elements, but you can tap outside the alert to get back to them again .

Ideally if the alert is displayed, the only accessible elements should be those inside the alert, until it is dismissed. It seems with VoiceOver off, I can't tap on anything outside the alert, so maybe it's just a matter of setting accessibilityElementsHidden https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAccessibility_Protocol/#//apple_ref/occ/instp/NSObject/accessibilityElementsHidden on the right element? I'm not sure how UIAlertController does it...

wimagguc commented 8 years ago

This seems to be a fair point, thanks! I don't have much experience using VO, so I'll just leave the Issue open here for everyone else to see.

rosano commented 8 years ago

Could you maybe point to where in the code it prevents the non-VO user from tapping anything outside the alert? I can try experimenting there

wimagguc commented 8 years ago

It also depends on how the alert is attached to the view. It might be added as a subview of the parentView that the user passed on, or, as a subview of [[[UIApplication sharedApplication] windows] firstObject]

In either way, the CustomIOSAlertView view overlays the whole parent view it's attached to. This subview then keeps the user from being able to tap on anything in the parent.