I have a simple slide menu project in SwiftUI, and I want to add bottom navigation bar in my project, but when I click the slide menu button, I want to draw bottom navigation bar as well like in image. Any idea will be appreciated.
Drawer:
Drawer:
Code Block struct Home: View { // Hiding tab Bar... init() { UITabBar.appearance().isHidden = true } @StateObject var menuData = MenuViewModel() @Namespace var animation var body: some View { HStack(spacing: 0){ // Drawer And Main View... // Drawer... Drawer(animation: animation) // Main View... TabView(selection: $menuData.selectedMenu){ Catalogue() .tag("Catalogue") Orders() .tag("Your Orders") Cart() .tag("Your Cart") Favourites() .tag("Favourites") } .frame(width: UIScreen.main.bounds.width) } // Max Frame... .frame(width: UIScreen.main.bounds.width) // Moving View.... // 250/2 => 125.... .offset(x: menuData.showDrawer ? 125 : -125) .overlay( ZStack{ if !menuData.showDrawer{ DrawerCloseButton(animation: animation) .padding() } }, alignment: .topLeading ) // Setting As Environment Object.... // For Avoiding Re-Declarations... .environmentObject(menuData) } }