---
title: "loadAsync(contentsOf:withName:options:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/textureresource/loadasync(contentsof:withname:options:)"
---

# loadAsync(contentsOf:withName:options:)

Asynchronously loads a texture resource from a URL with options.

## Declaration

```swift
@MainActor @preconcurrency static func loadAsync(contentsOf url: URL, withName resourceName: String? = nil, options: TextureResource.CreateOptions) -> 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.
- `options`: A configuration for generating the texture.

## Return Value

Return Value A load operation that publishes the resource.

## Discussion

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.

## See Also

### Deprecated

- [generate(from:withName:options:)](realitykit/textureresource/generate(from:withname:options:).md)
- [generateAsync(from:withName:options:)](realitykit/textureresource/generateasync(from:withname:options:).md)
- [replaceAsync(withImage:options:)](realitykit/textureresource/replaceasync(withimage:options:).md)
- [generate(from:named:options:)](realitykit/textureresource/generate(from:named:options:).md)
