When writing layout code, you should rely on the view/viewController's traitCollection instead of just the frame of the view.
However, when executing the snapshot tests for a device, the traitCollection during the test execution is the same as the current simulator, which is not ideal when using expect(view).toMatchSnapshot(for: .allDevices) since an invalid collection is passed here.
We should either notify this in the documentation or (preferably) override the traitCollection of the UIView using override trait collection
When writing layout code, you should rely on the view/viewController's traitCollection instead of just the frame of the view.
However, when executing the snapshot tests for a device, the traitCollection during the test execution is the same as the current simulator, which is not ideal when using
expect(view).toMatchSnapshot(for: .allDevices)since an invalid collection is passed here.We should either notify this in the documentation or (preferably) override the traitCollection of the UIView using override trait collection