---
title: "preload(completionHandler:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/sktextureatlas/preload(completionhandler:)"
---

# preload(completionHandler:)

Loads an atlas object’s textures into memory, calling a completion handler after the task completes.

## Declaration

```swift
func preload(completionHandler: @escaping @Sendable () -> Void)
```

```swift
func preload() async
```

## Parameters

- `completionHandler`: A block called after the texture atlas is loaded.

## Mentioned in

Maximizing Texture Performance

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func preload() async For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. SpriteKit creates a background task that loads the texture data from the atlas object. Then, SpriteKit returns control to your game. After the texture atlas is loaded, your completion handler is called. If you need to preload multiple texture atlas objects immediately, use the preloadTextureAtlases(_:withCompletionHandler:) method instead.

## See Also

### Preloading Textures

- [preloadTextureAtlases(_:withCompletionHandler:)](spritekit/sktextureatlas/preloadtextureatlases(_:withcompletionhandler:).md)
- [preloadTextureAtlasesNamed(_:withCompletionHandler:)](spritekit/sktextureatlas/preloadtextureatlasesnamed(_:withcompletionhandler:).md)
