How to modify the UIScreen size without launching multiple simulators?

So I am running snapshot tests. For that i have selected 4 different screen sizes for the snapshots which i am running in loop and setting the frame of the UIViewController. This works when everything is auto layout-ed. But inside a view controller, if someone is reading UIScreen.main.bounds, the size that one gets is of the simulator. So to keeps things consistent, I want that when someone accesses the UIScreen.main.bounds, they get the size that I have used above instead of the simulator size.
If modifying the UIScreen size is not possible, please suggest some alternative solution for the same. Thanks!

Replies

I want that when someone accesses the UIScreen.main.bounds, they get the size that I have used above

what is this size used above ?

AFAIK, it is not possible to force UIScreen size.

So I am running snapshot tests. For that i have selected 4 different screen sizes for the snapshots which i am running in loop and setting the frame of the UIViewController.

As shown above, size mentioned is the different sizes i am using to render the screenshots