Good afternoon,
I have a problem on my app with the NavigationViews. When launching the app for the very first time, users are displayed a LogIn and Sign Up page (which does not have a TabView) and once they Log-In they are directed to a TabView with different sections (Home, Chats, etc...).
The main problem that I have is that when changing from the Login view to the TabView,the NavigationTitle that is set is only that of HomeView and when changing to a different tab, the title does not change. How could I solve this problem, how do other apps deal with this?
Thank you.
File LoginView
import SwiftUI
struct LoginView: View {
var body: some View{
NavigationView{
NavigationLink(destination: TabView, label: Text("Login")
}
}
}
File TabView
import Swift UI
struct TabView: View {
var body: some View{
TabView {
HomeView()
.tabItem{
//Not relevant code
}
ChatView()
.tabItem{
//Not relevant code
}
}
}
}
File HomeView
import SwiftUI
struct HomeView: View {
var body: some View {
ZStack{
//Not relevant code
}
.navigationBarTitle("Home")
}
}
File ChatsView
import SwiftUI
struct ChatsView: View {
var body: some View {
ZStack{
//Not relevant code
}
.navigationBarTitle("Chats")
}
}