Setting tint for widget snapshot tests iOS 18

We have widget snapshot tests using XCTest as shown below:

func testHomeWidgetView() {
            let widgetView = HomeWidgetView(
                state: .done,
                text: "All done!"
            ).frame(width: 170, height: 170)
            assertSnapshot(matching: widgetView, as: .image)
        }
    }

Is it possible to apply a tint to the widgets in snapshot tests like a user can from their home screen in iOS 18? We'd like to capture snapshots of our widget while tinted via the home screen.

There's no supported way for you to simulate a dimmed mode with the APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Setting tint for widget snapshot tests iOS 18
 
 
Q