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

# preloadTextureAtlasesNamed(_:withCompletionHandler:)

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

## Declaration

```swift
class func preloadTextureAtlasesNamed(_ atlasNames: [String], withCompletionHandler completionHandler: @escaping @Sendable ((any Error)?, [SKTextureAtlas]) -> Void)
```

```swift
class func preloadTextureAtlasesNamed(_ atlasNames: [String]) async throws -> [SKTextureAtlas]
```

## Parameters

- `atlasNames`: An array containing the atlas names to preload.
- `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 preloadTextureAtlasesNamed(_ atlasNames: [String]) async throws -> [SKTextureAtlas] 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 atlases are loaded, your completion handler is called.

## See Also

### Preloading Textures

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