swiftuiios15xcode13

iOS15 Xcode 13 Global Accent Color not working


I'm using the latest beta of Xcode 13 with an app for iOS 14 and now I'm facing this strange issue: The global accent color of my app was working fine until the iOS 15 update when the color is now set as the default blue where before it was my custom color.

Here is the asset catalog:
enter image description here

This is my project settings page where you can see that the accent color is correct.
enter image description here

And this is what the app looks like when built. The color is the default blue when it needs to be a really dark blue/purple color.
enter image description here


Solution

  • I finally found a temporary workaround on this AppleDeveloperForum Thread

    credit to: @chad_sykes for this 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)
            }
        }
    }