---
title: "aspectRatio(for:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/imagepresentationcomponent/aspectratio(for:)"
---

# aspectRatio(for:)

The aspect ratio of the image this component will present for the requested viewing mode.

## Declaration

```swift
func aspectRatio(for viewingMode: ImagePresentationComponent.ViewingMode) -> Float?
```

## Return Value

Return Value Returns nil if the requested viewing mode is not in the component’s availableViewingModes set.
