There is a global variable UITraitCollection.current that allows you to override the current traitCollection globally, at the stage of rendering the component.
It would be nice to add an override for this variable, since we use this property in SwiftUI in the project and it has a value from the host simulator, and not an overridden one.
The reason is that SwifUI.View.body is rendered at the moment when
config.size = hostingController.sizeThatFits(in: maxSize)
That is, until the moment when it is called:
rootViewController.setOverrideTraitCollection(traits, forChild: viewController)