Is there something similar to UIScreen.main.bounds
on visionOS?
I have some code that depends on the screen size and using a hard coded value for it doesn’t really work out unfortunately.
Is there something similar to UIScreen.main.bounds
on visionOS?
I have some code that depends on the screen size and using a hard coded value for it doesn’t really work out unfortunately.
This doesn't exist on visionOS. UIScreen and UIWindow are different classes on iOS, and while there are UIWindows on visionOS, there's no analog of UIScreen (the class itself in marked unavailable
). The visionOS 'screen' is not really measured in points, but in degrees of field-of-view, and as such, you can't really convert between the two. You can always get the size of the current window by using a GeometryReader.