My TabView looks like this:
var body: some View {
TabView {
TabView1()
.tabItem() {
Image("...")
Text("...")
}
.onAppear { ??? }
TabView2()
.tabItem() {
Image("...")
Text("...")
}
}
.onAppear { ??? }
}
When I enter the TabView, I'll be on TabView1. What I want to do is to load the content inside TabView2 when I'm on TabView1, so that the content in TabView2 is prepared when I click and switch to it.
I'm guessing that I need to do something in any of the .onAppear methods, but what exactly should I do? Thanks a lot!