I'm trying to learn SwiftUI and I'm wondering its possible to have both Navigation bar and a Tabbar in the same project?
I currently have a tabbar but I need to to have a Navigation bar with some buttons and a logo in the middle.
How do I achieve this?
This is my current code:
struct ContentView: View {
var body: some View {
TabView {
NavigationView{
FirstView()
}
.tabItem {
VStack{
Image(systemName: "house.fill")
Text("Home")
}
}
NavigationView{
SecondView()
}
.tabItem {
VStack{
Image("second")
Text("Second")
}
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}