Type Method


Sets the default leaderboard for the local player.


class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil)



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 nil.


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.

See Also

Deprecated Methods and Properties

var category: String?

The named leaderboard to retrieve information from.

init?(playerIDs: [String]?)

Initializes a leaderboard request to retrieve the scores of a specific group of players.

class func loadCategories(completionHandler: (([String]?, [String]?, Error?) -> Void)?)

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