---
title: "displayTransform(viewRotationAngle:viewportSize:)"
framework: arkit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+]
path: "arkit/arframe/displaytransform(viewrotationangle:viewportsize:)"
---

# displayTransform(viewRotationAngle:viewportSize:)

Returns a display transform for the provided viewport size and view angle.

## Declaration

```swift
func displayTransform(viewRotationAngle: CGFloat, viewportSize: CGSize) -> CGAffineTransform
```

## Parameters

- `viewRotationAngle`: The view rotation angle, in degrees, of the viewport.
- `viewportSize`: The size of the viewport.

## Return Value

Return Value The display transform matrix.

## Discussion

Discussion The display transform can be used to convert normalized points in the image-space coordinate system of the captured image to normalized points in the view’s coordinate space. The transform provides the correct rotation and aspect-fill for presenting the captured image in the given view angle and size. The view angle, in degrees, is the clockwise rotation needed to keep the camera image level with the horizon (0 LandscapeRight, 90 Portrait, 180 LandscapeLeft, 270 PortraitUpsideDown). Obtain it from ARSession.viewRotationAngle.
