White background in UIHostingController

Good morning!

Our app is currently a mix of UIKit and SwiftUI. All new code is SwiftUI and we’re gradually replacing old code but for now we have SwiftUI views in UIHostingControllers where needed.

Our app is a dark color scheme regardless of the device light/dark setting.

One issue we’ve have is that some view in the hierarchy of the UIHostingController seems to have a white background. This is not normally visible, but when sliding views on and off in navigation, there’s a hint of white showing at the edge of the view as it moves. It’s subtle but users have noticed.

I thought I filed this bug some time ago but I can’t find it. Just wondering if you’re aware and if there’s any update.

Answered by Frameworks Engineer in 892383022

Hi! If you're able to file a new bug, preferably with a sample project that reproduces the issue you're seeing, that would help.

Without seeing your exact setup, it's hard to troubleshoot this, but if I were debugging this issue, I would start by trying to reduce things down by commenting out views in the hierarchy until the issue stops appearing.

If the minimal case still shows the issue, that would be a good starting point for a sample project to include along with your bug report.

Hi! If you're able to file a new bug, preferably with a sample project that reproduces the issue you're seeing, that would help.

Without seeing your exact setup, it's hard to troubleshoot this, but if I were debugging this issue, I would start by trying to reduce things down by commenting out views in the hierarchy until the issue stops appearing.

If the minimal case still shows the issue, that would be a good starting point for a sample project to include along with your bug report.

White background in UIHostingController
 
 
Q