In a tvOS app I have two buttons and would like to determine which one has focus when selected. Using func pressesBegan works for nw.
override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
guard let selected = UIScreen.main.focusedItem else { return }
Xcode tells me that focusedItem is deprecated and I should use -[UIWindowScene focusSystem].focusedItem instead. Any suggestions on a code snippet that could be used.
Thanks