An object that organizes leaderboards into logical and coherent groups.


class GKLeaderboardSet : NSObject


A GKLeaderboardSet object is used to read data from a leaderboard set stored on Game Center. Your game uses GKLeaderboardSet objects when it wants to retrieve localized information about a specific leaderboard set or to retrieve scores from a leaderboard set. Typically, you do this when you want the data needed to implement your own custom leaderboard set user interface.

After incorporating leaderboard sets into your app, you must put all of your leaderboards into a set. Individual leaderboards can be put into multiple leaderboard sets and given different display names in each set.

During the development process, you create the leaderboard sets for your game in App Store Connect.

To retrieve information about the available leaderboards for the current set, use the loadLeaderboards(completionHandler:) class method.

To retrieve information about the available leaderboard sets, use the loadLeaderboardSets(completionHandler:) class method.

To retrieve information about the image associated with a leaderboard set, use the loadImage(completionHandler:) class method.


Loading the Leaderboard Sets

func loadImage(completionHandler: ((UIImage?, Error?) -> Void)?)

Load the image associated with the leaderboard set.

func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)?)

Load all of the leaderboards for the current leaderboard set.

var title: String

Localized title for the leaderboard set.

var identifier: String?

The identifier for the leaderboard set.

var groupIdentifier: String?

Identifies the group that the leaderboard set belongs to.


Inherits From

See Also


class GKLeaderboard

An object used to read data from a leaderboard stored on Game Center.

class GKScore

An object containing information for a score that was earned by the player.