<!--
{
  "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/TextureResource/loadAsync(contentsOf:withName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15TextureResourceC9loadAsync10contentsOf8withNameAA11LoadRequestCyACG0B03URLV_SSSgtFZ"
  },
  "title" : "loadAsync(contentsOf:withName:)"
}
-->

# loadAsync(contentsOf:withName:)

Asynchronously loads a texture resource from a URL.

```
@MainActor @preconcurrency static func loadAsync(contentsOf url: URL, withName resourceName: String? = nil) -> LoadRequest<TextureResource>
```

## Parameters

`url`

The path or address of the file to load.

`resourceName`

A unique name the method assigns to the resource it loads,
for use in network synchronization.

## Return Value

A load operation that publishes the resource.

## Discussion

RealityKit uses the resource name to distinguish resources locally, and to match
texture resources between networked peers. Specify a unique name for
each texture resource you load or generate.

---

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)