Asperi-Demo / 4SwiftUI

MIT License
215 stars 28 forks source link

Handle Focus on tap of remote Menu Button with custom tabview #2

Closed ghost closed 2 years ago

ghost commented 2 years ago

I have a custom tab view, How I can get focus on top menu items, when remote MENU is pressed, The List is scrolling to top as expected but not getting focus on the custom top menu.

@ViewBuilder
private var tabView: some View {
    TabView(selection: $viewModel.currentTab) {
        HomeView()
            .tag(MenuTab.home)
        DummyView()
            .tag(MenuTab.teams)
        Color.green
            .tag(MenuTab.games)
        Color.blue
            .tag(MenuTab.search)
    }
    .tabViewStyle(.automatic)
    .introspectTabBarController { tabBarController in
        tabBarController.tabBar.isHidden = true
    }
}

Simulator Screen Shot - Apple TV 4K (2nd generation) - 2022-06-03 at 15 32 32

ghost commented 2 years ago

@Asperi-Demo : Can you help me on this?