79360033

Date: 2025-01-16 00:06:00
Score: 1.5
Natty:
Report link

SwiftUIIntrospect works, but has to be updated with every iOS Update, and it is not guaranteed that it will continue to work because Apple/Swift might change the underlying code.

I came to the conclusion that using NavigationStack only makes sense as the top-level visual Container of ContentView(or MainView, however you call your top-level View) and also only if you plan on navigating in Fullscreen mode only. If so, just put it atop, put a VStack, HStack, ZStack or whatever you might need on level 2, and then set the background on level 2 and voila you have a consistent background for all views, regardless of navigation.

If you however want to navigate within PARTS OF THE DISPLAY, I suggest using something else than NavStack. Maybe a ZStack-driven and/or @State-driven structure.

Hate to say it, but the fact that NavStack refuses to inherit a background might be the usual Apple "It's a feature, not a bug." thing.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @State-driven
  • Low reputation (0.5):
Posted by: CameronBaba