Hi there,
i just watched the wonderful video “How to build a Custom Tab Bar” and wanted to know how do I switch to a different View (in this case to Chats) with the “Button command”
Here is my code:
import SwiftUI
struct CustomTabBar: View {
var body: some View {
HStack {
Button {
//Switch to Chats
} label: {
VStack (alignment: .center, spacing: 4){
Image("grafik")
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)
Text("Chats")
}
}
}
.frame(height:82)
}
}
struct CustomTabBar_Previews: PreviewProvider {
static var previews: some View {
CustomTabBar()
}
}
Thank you