Hello,
I'm new to swift and wanted to see how to set the background color for every view. after trying several things I am having some difficulty doing so.
It would be code repetition to individually set the background color for each individual view therefore, I'd like to set the background color for every view in one place.
Based on some reading, it made sense to me that this would be set in the main ContentView however, this has not been working for me. I'm probably missing something. Any help is appreciated. Thank you.
code example:
@main
struct HockeyAppApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.background(Color.gray)
}
}
}