Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliesup-voted.tooltip
I independently reproduced this issue before I found this thread using the final Xcode 14.0. I found that my UIHostingViewController subclass was able to modify the status bar style by implementing the .preferredStatusBarStyle property if the hosted SwiftUI View just contained a Text, but as soon as I wrapped that Text in a NavigationView it no longer works. Checking the "Debug View Hierarchy" confirms that the whole view hierarchy changes pretty significantly just by adding the NavigationView inside of the View inside of the hosting view controller. One difference is that in my testing even setting .navigationBarHidden(false) did not restore the ability to change the status bar style. Opening the same project in Xcode 13.4.1 and running in iOS 15.5 simulator the status bar style changes as expected.
The suggestion from @taxiboatdriver is using iOS 16-only APIs so I don't think that is a solution for my app that's targeting iOS 15+. If anyone else has any solutions I'm still searching...