How to manage focus when you use container ViewControllers

757 Views Asked by At

How to manage FocusGuide in tvOS when you have container view/views? I'm using a MasterViewController and have more than one container view controllers and it all together act like UITabBarController. But when I navigate between buttons it's not navigating to selected viewController's preferred focus environments. Buttons are arranged horizontally and container view controllers always under the tabs. I don't know how to manage them.

1

There are 1 best solutions below

0
On BEST ANSWER

My app has been running smoothly in the market for a long time. Now I can easily say that the container view controller does not matter.

All the elements we see on the screen work in the same logic. If the focus engine cannot find an item on the targeted direction (while you do right-left or up-down with the remote control), it will not navigate.

So how to fix that? You need to create an invisible focus item (a view) that automatically redirect to the preferred view. And you'll need the handle same for opposite direction too! You need to help focus engine for the current situation.

In order to avoid such situations, I recommend that you talk to your UI / UX department about the TV experience and re-arrange some screens if necessary.

Lastly, I highly recommend you to use default UITabBarController for Apple TV and don't create your own version of it until learning User experience of Apple Tv.