Skip to main content
←API Reference ←NSDK ←ImageMath

viewRotation


Declaration​

static func viewRotation(fromOrientation: UIInterfaceOrientation, toOrientation: UIInterfaceOrientation) -> CGAffineTransform

Summary​

Returns an affine transform that rotates between two interface orientations around the center.
This method models UI rotation (opposite to physical device rotation).
For example, rotating from .landscapeRight to .portrait results in a counter-clockwise transform.

Returns​

A CGAffineTransform representing the rotation.

Parameters​

NameTypeSummary
fromOrientationUIInterfaceOrientation
The starting interface orientation.
toOrientationUIInterfaceOrientation
The target interface orientation.