Thanks for taking your time to help others :)
Problem description:
I'm starting a new iOS 14-16 app with SwiftUI. In this new app, we removed AppDelegate and SceneDelegate logic, just trying to simplify, using just the WindowGroup.
The thing is, all the views in the App has to present a white status bar (for dark content) and, in that way, I tried to configure the status bar a single time, at Info.plist... But nothing worked, every page on the internet asks me to do the same...
And, has to be shown alongside the launch screen, cause is also dark content-like.
What I'm doing:
On Info.plist, I apply the following values:
View controller-based status bar appearance
with valueNO
Status bar style
with valueDark Content
And maybe a little redundant but on Project > General > Deployment Info > Status Bar Style: Dark Content
Simple code of the actual View:
import SwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
NavigationView {
VStack {
Text("This is a simple view. Status bar has to be white.")
}
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
}
Questions
- Why is not applying the color ?
- Is there any way to modify it, that's not deprecated and compatible with no Scene/AppDelegate + WindowGroup ?
- Does .preferredColorScheme(.dark) affects in any way to native elements such as .contextMenu() ? Or just to the tint of the status bar?