Find errors and determine why the next focused item isn't what you expected.
With the use of indirect controls for your tvOS app, it's imperative that focus works correctly. To help you find focus problems, Apple provides two debugging tools:
Turn on Live Focus Logging
See how the focus engine determines which view is currently in focus by turning on live focus logging. As the user moves focus, the log updates, showing how the new view came into focus.
In your Xcode project, select Edit Scheme and add
-UIFocus to the Arguments Passed On Launch section.
On launch, all focus events are logged and displayed in the Xcode console and Console.app. Logs are updated as focus changes in your app.
Find Focus Issues Using UIFocusDebugger
UIFocus class contains several methods to help you find focus issues. You don't use this class or its methods directly from your code. Instead, during a debugging session, you call the methods of this class from the LLDB debugger command line to obtain information about the state of the focus system. For example,
po UIFocus returns the state of the focus engine.