I'm looking for a way to make a custom transition when changing the focus from or to the UITabBar.
I'm currently trying this by overriding the didUpdateFocus method but I seem to be unable to check if the the tabBar is focused. 
The tabBar itself seem to never be in the "focused" state:
override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinatora)
{
    super.didUpdateFocus(in: context, with: coordinator)
    print(self.tabBar.isFocused) // always false
}
When checking the UIFocusUpdateContext the currently focused element is a UITabBarButton. 
But I'm unable to check if the context is an instance of UITabBarButton because that type isn't available:
context.nextFocusedItem is UITabBarButton // can't compile
I'm really stuck here and would love any suggestions on how to tackle this one.
Thanks.
                        
First add extension for
UIViewif it has superview:Then add extension for
UIFocusUpdateContextto check if view has focus:Then use context in this method to check if tabbar has focus:
Also please override this method in your UITabBarController subclass