In this short Swift code example we will learn how to determine main screen bounds as well as screen hight and width in Swift.
- Get main screen bounds
- Get screen width
- Get screen height
// Get main screen bounds let screenSize: CGRect = UIScreen.main.bounds let screenWidth = screenSize.width let screenHeight = screenSize.height print("Screen width = \(screenWidth), screen height = \(screenHeight)")