Tab Bar Controller focus/gesture change between tvOS 9 and 10?

814 Views Asked by At

I implemented a simple Tab Bar Application in tvOS 9.x. Navigation worked as described in Apple's doc here (https://developer.apple.com/reference/uikit/uitabbarcontroller?language=objc), such that the tab bar became hidden when selecting a content view or swiping down, became visible when swiping up.

Having updated my dev AppleTV to tvOS10, the same unmodified project, when run, does not exhibit this behaviour any more. In fact I can only swipe left and right to change tabbed content views, but up/down does nothing. This same behaviour is present using the simulator.

I have created a new Tab Bar Application project to see if there are any UI property / source differences in the template project, but I cannot see any. The new bare-bones project behaves the same way.

It seems I cannot focus the content view any more with the documented controller actions. I have read other similar but distinct posts on SO, which talk about implementing a custom UITabBarController, others that discuss focus, but I did not want to tinker without understanding what has changed, if anything, or what I have missed on my tvOS journey.

I have not posted any code since the vanilla Tab Bar project I created in Xcode 8.0 (8A218a) exhibits this behaviour (in my set-up).

Any help greatly appreciated.

1

There are 1 best solutions below

0
On

tvOS 10 clearly has a behavioural change (with potentially an unintended side-effect) from tvOS 9.

I found the answer/workaround on the dev forum here (https://forums.developer.apple.com/thread/64886?q=tvos%20uitabbar).

Any custom view of a tab bar item should override the method

canBecomeFocused
to return YES.