---
title: "loadLeaderboards(completionHandler:)"
framework: gamekit
role: symbol
role_heading: Type Method
path: "gamekit/gkleaderboard/loadleaderboards(completionhandler:)"
---

# loadLeaderboards(completionHandler:)

Loads a list of leaderboards from Game Center.

## Declaration

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

```swift
class func loadLeaderboards() async throws -> [GKLeaderboard]
```

## Parameters

- `completionHandler`: A block to call when loading the leaderboards. The block receives the following parameters:

## Discussion

Discussion Use this class method to retrieve the list of leaderboards you configure in App Store Connect. Use the properties of each leaderboard object, especially the category and title properties, to learn more about the leaderboard. - (void) loadLeaderboardInfo {     [GKLeaderboard loadLeaderboardsWithCompletionHandler:^(NSArray *leaderboards, NSError *error) {         self.leaderboards = leaderboards;      }]; } 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.

## See Also

### Deprecated methods

- [setDefault(_:withCompletionHandler:)](gamekit/gkleaderboard/setdefault(_:withcompletionhandler:).md)
- [loadCategories(completionHandler:)](gamekit/gkleaderboard/loadcategories(completionhandler:).md)
- [loadScores(completionHandler:)](gamekit/gkleaderboard/loadscores(completionhandler:).md)
