Sobes.tech
Junior — Middle

What is the purpose of the UIScreen class in iOS development?

sobes.tech AI

Answer from AI

The UIScreen class in iOS represents the device's screen and provides information about its characteristics, such as size, resolution, scale, and brightness. With UIScreen, you can access the main screen or additional screens if they are connected. This is useful for adapting the interface to different devices and screens.

Example usage:

let screen = UIScreen.main
print("Screen size: \(screen.bounds.size)")
print("Screen scale: \(screen.scale)")
What is the purpose of the UIScreen class in iOS… - sobes.tech