I am simply trying to use the onTapGesture
function to change the value of the variable selectedTab
when a tab is picked by the user. This onTapGesture
function seems to not work because my variable isn't changing value and when I add a print statement that doesn't even execute.
@Binding var selectedTab: Bool
@EnvironmentObject var authViewModel: AuthViewModel
var body: some View {
TabView(){
NavigationView(){
FeedView()
}
.tabItem {
Image(systemName: "h.circle")
.onTapGesture {
self.selectedTab = false
}
}