Global Accent Color not used for Release builds on iOS 15 devices

I'm seeing some odd behaviour with our app when its compiled using Xcode 13 and deployed to an iOS 15 device/emulator for a Release build.

The global accent color that is defined in the Build Settings isn't being found in the Release build so the default blue color is shown. But on a Debug build it finds the accent color just fine. And if I deploy to an iOS 14 device/emulator it finds the accent color for both Release/Debug builds. 🤷

Answered by chad_sykes in 689863022

I found an alternate solution, which was to set the .accentColor on the main view in the WindowGroup and it gets used across the app.

@main
struct CurvApp: App {
    var body: some Scene {
        WindowGroup {
            myMainView
                .accentColor(CurvGlobalAppearance.curvAccentColor)
        }
    }
}

I wasn't able to reproduce this issue if I created a new project in Xcode 13 so I played around with my project configurations to see if it was due to an older project setting. I wasn't able to resolve the issue this way but it feels like there might be a path if you're persistent.

Accepted Answer

I found an alternate solution, which was to set the .accentColor on the main view in the WindowGroup and it gets used across the app.

@main
struct CurvApp: App {
    var body: some Scene {
        WindowGroup {
            myMainView
                .accentColor(CurvGlobalAppearance.curvAccentColor)
        }
    }
}
Global Accent Color not used for Release builds on iOS 15 devices
 
 
Q