<!--
{
  "availability" : [
    "iOS: 4.1.0 - 6.0.0",
    "iPadOS: 4.1.0 - 6.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKLeaderboard/loadCategories(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKLeaderboard(cm)loadCategoriesWithCompletionHandler:"
  },
  "title" : "loadCategories(completionHandler:)"
}
-->

# loadCategories(completionHandler:)

Loads the list of leaderboard categories along with their corresponding localized titles.

```
class func loadCategories(completionHandler: (@Sendable ([String]?, [String]?, (any Error)?) -> Void)? = nil)
```

## Parameters

`completionHandler`

A block to call after retrieving the categories from the server.

    The block receives the following parameters:

- *categories*: An array of `NSString` objects that provides the categories to your game. If an error occurs, this value may be non-`nil`. In this case, the array holds whatever data GameKit downloads before the error occurs.
- *titles*: An array of `NSString` objects that provides localized titles for each category. If an error occurs, this value may be non-`nil`. In this case, the array holds whatever data GameKit downloads before the error occurs.
- *error*: If an error occurs, this error object describes the error. If the operation completes successfully, the value is `nil`.

## Discussion

You use this class method to retrieve the category identifiers and titles you configure for your leaderboards in App Store Connect. To create a leaderboard query that targets a particular category, set the [`category`](/documentation/GameKit/GKLeaderboard/category) property to one of the strings that this method returns.

When you call this method, it creates a new background task to handle the request. The method then returns control to your game. When the task is complete, GameKit calls your completion handler on the main thread.

---

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)