A Boolean value indicating whether the user interface is currently presented in a landscape orientation.
SDKs
- iOS 8.3+
- Mac Catalyst 13.0+
Framework
- UIKit
Declaration
var isLandscape: Bool { get }
Parameters
orientation
Specify the orientation constant to check.
Return Value
Returns true
if the interface orientation is landscape, otherwise returns false
.
Discussion
The interface orientation can be different than the device orientation. You typically call this function in your view controller code to check the current orientation.