siteline/swiftui-introspect

How to hide tabbar in subview

liudhzhyym opened this issue · 0 comments

I am working with SwiftUI, and I have some issues with the TabBar. I want to hide the TabBar on a specific subview.

I find some code in https://stackoverflow.com/questions/58444689/swiftui-hide-tabbar-in-subview.

struct SomeView: View{
    
    @State var uiTabarController: UITabBarController?
    
    var body: some View {
        List {
            -your code here-
        }
        
        .navigationBarTitle("Title", displayMode: .inline)
        .introspectTabBarController { (UITabBarController) in
            UITabBarController.tabBar.isHidden = true
            uiTabarController = UITabBarController
        }.onDisappear{
            uiTabarController?.tabBar.isHidden = false
        }
    }
}

But I can not find introspectTabBarController method in the newest code. How can I use the new API to hide tabbar in sub view