Sets the default leaderboard for the local player.
- iOS 5.0–7.0Deprecated
- macOS 10.8–10.10Deprecated
- Mac Catalyst 13.0–13.0Deprecated
- watchOS 2.0–2.0Deprecated
The named leaderboard that should be the new default leaderboard for the local player.
A block to be called after the scores are retrieved from the server.
The block receives the following parameter:
If an error occurred, this error object describes the error. If the operation was completed successfully, the value is
The default leaderboard is used whenever your game uses a
GKScore object to report a score to Game Center without explicitly setting the score object’s
category property. The default leaderboard is normally set in App Store Connect. However, your game can use this class method to override the default leaderboard that appears for the local player. This information is stored for each player on Game Center.
When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.
If an error occurs and was a network error, your game should periodically resend the request until it completes.