switching to dark mode in UI test

Is there a way to switch dark mode on of off from within an UI test?


It would be great If something like

overrideUserInterfaceStyle
as was accessible through XCTest (as it is for UIView and UIViewController). It would be even better of dark mode could be switched dynamically within a test (simulating a user switching it through the control center).
Post not yet marked as solved Up vote post of cp101 Down vote post of cp101
1.4k views