<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ImagePresentationComponent/aspectRatio(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation26ImagePresentationComponentV11aspectRatio3forSfSgAC11ViewingModeV_tF"
  },
  "title" : "aspectRatio(for:)"
}
-->

# aspectRatio(for:)

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

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

## Return Value

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)