Post

Replies

Boosts

Views

Activity

Reply to SwiftUI reload TabView Tabs not properly
You can easily work around the problem by binding to TabView selection and setting the current tab manually like so: struct ContentView: View { 		@State private var currentTab = 0 		var body: some View { 				TabView(selection: $currentTab) 						{ 								TabAView() 										.tabItem({Text("Tab A")}) 										.tag(0) 										.onAppear() { 												self.currentTab = 0 										} 								TabBView() 										.tabItem({Text("Tab B")}) 										.tag(1) 										.onAppear() { 												self.currentTab = 1 										} 				} 		} }
Dec ’20