I have noticed a bug introduced when building with Xcode 14.
The navigation bar of my swiftui view is whited out and does not properly display the title, back button or other navigation items. There are a few other people who have experienced this based on my post to stack overflow.. It is clearly a change in how Xcode builds the app.
I have verified that building with Xcode 13.4.1 produces the expected navigation bar. I manually downloaded 13.4.1 in order to continue deploying builds without this bug but I know eventually I will have to investigate why Xcode 14 is causing this issue. My team is blocked from updating Xcode until this issue is resolved.
The navigation bar is programmatically set through a view controller using a UIHostingController as its rootView. I have found that this only happens when injecting swiftui into a UIKit app using UIHostingController. The SwiftUI view does not use a NavigationView so there shouldn't be any overlap between what is displayed in the navigation bar from the viewController and what is displayed from the SwiftUI view.
Reproduction steps:
- Build an app with Xcode 14.0.1
- Run the app on an iPhone
- Notice the navigation bar is whited out when using a UIHostingController to inject SwiftUI
I figured out the issue, if anyone else has this issue you can find my the solution here