---
title: "preloadTextureAtlases(_:withCompletionHandler:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/sktextureatlas/preloadtextureatlases(_:withcompletionhandler:)"
---

# preloadTextureAtlases(_:withCompletionHandler:)

Loads the textures of multiple atlas objects into memory, calling a completion handler after the task completes.

## Declaration

```swift
class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas], withCompletionHandler completionHandler: @escaping @Sendable () -> Void)
```

```swift
class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) async
```

## Parameters

- `textureAtlases`: An array of doc://com.apple.spritekit/documentation/SpriteKit/SKTextureAtlas objects.
- `completionHandler`: A block called after all of the texture atlases are loaded.

## 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: class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) 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 all of the specified atlas objects. Then, SpriteKit returns control to your game. After the atlas objects are loaded, your completion handler is called.

## See Also

### Preloading Textures

- [preload(completionHandler:)](spritekit/sktextureatlas/preload(completionhandler:).md)
- [preloadTextureAtlasesNamed(_:withCompletionHandler:)](spritekit/sktextureatlas/preloadtextureatlasesnamed(_:withcompletionhandler:).md)
