Tvos How to allow the user to move focus more freely?

I create a card game (for tvos) where the user must be able to remove cards from the board. At the end of the game, only a few cards can be left on the board, and they can, for example, be located in the form of buttons in the figure below.

How can I let the user move the focus from button 1 to 0 or 2?

Unacceptable answers to a similar question in SO were suggested to be used UIFocusGuide. I don’t think this answer applies to my problem, because in this approach you need to specify focusGuide in advance preferredFocusedView(for example, before the user siri-remote)! In my case, the preferred next focus depends on the direction of the finger, for example. focusHeading.

enter image description here

+4
1

UIFocusGuide - , a preferredFocusedView , , ( ).

, , , 1 0 2.

, , 0.

1, , 2 .

enter image description here

, , . , , 0 , preferredFocusedView , 1, 0 1.

enter image description here

, , Focus Engine . , , .

+8

Source: https://habr.com/ru/post/1621706/


All Articles