<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKLeaderboard/loadEntries(for:timeScope:range:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKLeaderboard(im)loadEntriesForPlayerScope:timeScope:range:completionHandler:"
  },
  "title" : "loadEntries(for:timeScope:range:completionHandler:)"
}
-->

# loadEntries(for:timeScope:range:completionHandler:)

Returns the scores for the local player and other players for the specified type of player, time period, and ranks.

```
func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping @Sendable (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, (any Error)?) -> Void)
```

## Parameters

`playerScope`

Specifies whether to get scores from friends or all players.

`timeScope`

Specifies the time period for the scores. This parameter is applicable to nonrecurring leaderboards only. For recurring leaderboards, pass [`GKLeaderboard.TimeScope.allTime`](/documentation/GameKit/GKLeaderboard/TimeScope-swift.enum/allTime) for this parameter.

`range`

Specifies the range of ranks to use for getting the scores. The difference between the minimum rank and maximum rank must not exceed `100`.

`completionHandler`

A block that GameKit calls when this method completes the request.

    The block receives the following parameters:

- localPlayerEntry: The score for the local player, or `nil` if the player has no score.
- entries: The scores this method loads that match the `playerScope`, `timeScope`, and `range` parameters, including the local player’s score if it exists.
- totalPlayerCount: The total number of players whose scores match the `playerScope` and `timeScope` parameters, but not the `range` parameter.
- error: Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

GameKit uses the following algorithm to fetch [`GKLeaderboard`](/documentation/GameKit/GKLeaderboard) scores:

1. Begins with the set of all possible scores for the leaderboard.
2. Discards any scores that don’t match the `playerScope` and `timeScope` properties.
3. For each player, keeps the best score that player earns and discards the rest.
4. Sorts the scores from best to worst.
5. Uses the range property to determine which scores return.

---

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)