I'm working on a card game in SpriteKit, and I think it's a candidate for VoiceOver support.
I'm having a hard time finding resources on how to properly do this, however. It seems like VoiceOver is mainly designed to play nice with UIKit controls, but not so much SpriteKit scenes. Near as I can tell, I need to treat my entire SpriteKit view as a VoiceOver "container" view and then use the informal protocol of having accessibilityElementCount(), etc., report the accessible elements.
I have this working, to an extent. I can make my placards readable and my buttons clickable with VoiceOver. But I'm running into a lot of other daunting issues, and it just seems like I must be missing something. For instance:
* VoiceOver auto-selects a node I don't want it to when it starts up and starts reading it. This is a problem because it's not the "right" node I'd want selected, and I often want to have it say something to the user when a new scene is loaded, and auto-selecting the node cancels that. How do I prevent this behavior?
* Sometimes, VoiceOver selects an SKLabelNode and speaks its text, which is weird because I didn't code it to do that. It implies that there might be some kind of intentional VoiceOver support behind the scenes. Is there? Am I missing some documentation somewhere that describes this? How do I turn it off if I want to handle speaking that text at a higher level (i.e., if I have two SKLabelNodes showing a sentence over two lines, I want one rollover area that speaks the whole sentence, not two rollover areas that speak the first half and the second half of a sentence)?
* I have a reference scene where I have a bunch of cards in a scrollable area, where you can scroll through them, tap on one, and get information about it. How do I translate that sort of interaction to something that works with VoiceOver? Normally, this would be done with some kind of paged control (I think?), but there's no equivalent in SpriteKit that I'm aware of. Am I supposed to roll my own solution? Do I need to translate that to something that only uses buttons (which feels like it would be an inferior solution for people who aren't relying on VoiceOver). What are the best practices here?
* How do I just let the player know something happened to something on the screen that isn't a UI layout change? - i.e., "You drew an ace of spades and a two of clubs" kind of information. The cards all draw to the same place on the screen, so it's not really a layout change, but it's different information on the screen. (Or is it a layout change because there are cards in those "wells" where there were none before?)
* And if I do change the layout, how do I tell the VoiceOver system that the layout has changed without it deciding to change the current selection or otherwise taking over? Again, if a new card comes out, it should be tappable, but I'd rather VoiceOver speak something to this effect rather than trigger the default thing where it goes and tries to auto-select something.
Clearly, I'm adrift a bit here. I'm not sure I'm expressing myself well here because I'm still a little fuzzy on how it should all work, and the documentation I'm reading isn't really clearing it up for me.
What I'd really like to see is an in-depth discussion about how to properly add VoiceOver support to a SpriteKit game that hits these sorts of topics and goes through the proper structure for supporting VoiceOver, showing examples of how it's supposed to be done. Anyone have any resources they can point me to?