Placing the TabView in a NavigationView like @gcliu and @l\_o\_o\_l mentioned works. In addition, to solve @l\_o\_o\_l problem for the navigationBarTitle, all you need to do is pass the selection as the title, no need for the switch statement. Works if you specify your state variable as a string. And you can use large title with this solution.
struct Dashboard: View {
@State private var selection = "Cards"
var body: some View {
NavigationView {
TabView(selection: $selection) {
CardList()
.tag("Cards")
.tabItem {
Image("cards")
Text("Cards")
}
Text("Profile Page")
.tag("Profile")
.tabItem {
Image("user")
.foregroundColor(.black)
Text("Me")
}
}
.navigationBarTitle(self.selection)
}
}
}
NB: The CardList() view contains the NavigationLink for each card.
Post
Replies
Boosts
Views
Activity
This basic feature is very much needed SwiftUI team.
Any answers?
@ronjoy did you go ahead on to production? Did you notice any difference? Was it near realtime?
@DaXmYsT It seems the ID specified is base64 encoded. Try decoding it and using the decoded value.