<!--
{
  "availability" : [
    "iOS: 13.0.0 - 18.0.0",
    "iPadOS: 13.0.0 - 18.0.0",
    "macCatalyst: 13.0.0 - 18.0.0",
    "macOS: 10.15.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/EnvironmentResource/loadAsync(named:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation19EnvironmentResourceC9loadAsync5named2inAA11LoadRequestCyACGSS_So8NSBundleCSgtFZ"
  },
  "title" : "loadAsync(named:in:)"
}
-->

# loadAsync(named:in:)

Asynchronously loads an environment resource from a bundle.

```
@MainActor @preconcurrency static func loadAsync(named name: String, in bundle: Bundle? = nil) -> LoadRequest<EnvironmentResource>
```

## Parameters

`name`

The image name without the file extension.

`bundle`

The bundle to search for the resource. Use `nil` to indicate the app’s bundle.

## Return Value

The environment resource that loads from the specified bundle.

## Discussion

If your image file is at the path `Foo.skybox/Bar.exr` in your Xcode project, use
`Bar` for the name parameter.
You need to call this function with the `async` keyword from an asynchronous context,
such as from within a <doc://com.apple.documentation/documentation/Swift/Task> closure.

To add an environment resource to your Xcode project, see [`EnvironmentResource`](/documentation/RealityKit/EnvironmentResource).

---

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)