I’ve set up my TabViews in the following manner
TabView(selection: $selectedView) {
Home().tag("home")
Settings().tag("settings")
Feed().tag("feed")
if isActivityRoute {
Activity().tag("activity")
ActivityReport().tag("activityReport")
}
}
I have few conditional routes under isActivityRoute
reason for this is to ensure that when user starts a certain activity, those 2 views are started in a clean / pristine state, as they have few timers, state, screenphase listeners set up etc… and it seems like some of these remain active / maintain their state even if user goes to a different tab.
While this works, I am loosing new ios 18 transition animation between tabs. So I am wondering if there is another way to ensure that these tabs remain inactive and start “fresh” when user navigates to them or away.