IosDeviceOrientationImpl

IosDeviceOrientationImpl is an implementation of the DeviceOrientation interface specific to iOS devices. This class retrieves the current orientation of the iOS device by accessing the window's interface orientation from the UIKit framework. It uses UIApplication.sharedApplication.connectedScenes to determine the device's orientation.

The class provides properties and methods to check whether the device is in portrait or landscape mode.

Author

N7ghtm4r3 - Swapnil Musale

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val isLandscape: Boolean

isLandscape checks if the device is currently in landscape mode.

Link copied to clipboard
open override val isPortrait: Boolean

isPortrait checks if the device is currently in portrait mode.

Link copied to clipboard
private val windowOrientation: Int?

windowOrientation holds the current interface orientation of the first window, which is converted to an integer value.

Link copied to clipboard
private val windows: List<*>

windows represents the list of windows currently active in the iOS application.

Functions

Link copied to clipboard
open override fun getDeviceOrientation(): String

Method to get the current orientation of the device