<!--
{
  "availability" : [
    "iOS: 5.0.0 - 12.0.0",
    "iPadOS: 5.0.0 - 12.0.0",
    "macOS: 10.8.0 - 10.14.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GLKit",
  "identifier" : "/documentation/GLKit/GLKTextureLoader/cubeMap(withContentsOfFiles:options:queue:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GLKTextureLoader(im)cubeMapWithContentsOfFiles:options:queue:completionHandler:"
  },
  "title" : "cubeMap(withContentsOfFiles:options:queue:completionHandler:)"
}
-->

# cubeMap(withContentsOfFiles:options:queue:completionHandler:)

Asynchronously loads a cube map texture image from a series of files and creates a new texture from the data.

```
func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: dispatch_queue_t?, completionHandler block: @escaping @Sendable (GLKTextureInfo?, (any Error)?) -> Void)
```

## Parameters

`paths`

An array of paths to the six files that make up the cube map.

`options`

A dictionary that describes any additional steps you want the texture loader to take when loading the texture. See [Texture Loading Options](/documentation/GLKit/texture-loading-options).

`queue`

A dispatch queue that your block is called on when the task completes. If `NULL` is passed, the block is called on the main dispatch queue.

`block`

A block to be called when the task completes.

## Discussion

This method is identical to [`cubeMap(withContentsOf:options:)`](/documentation/GLKit/GLKTextureLoader/cubeMap(withContentsOf:options:)), except that it loads the texture asynchronously. When this method is called, it creates a new background task to handle the request and then returns control to your app. Later, when the task is complete, GLKit calls your completion handler on the queue you provided.

---

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)