Instance Property


The named leaderboard that is displayed by the view controller.


var leaderboardCategory: String? { get set }


The category property must either be nil or it must match a category identifier you defined when you created your leaderboards in App Store Connect. If nil, the view displays scores for the aggregate leaderboard. Default is nil.

When the leaderboard is presented, the value of this property determines which leaderboard content is displayed to the player. As the player changes which leaderboard content they view, the leaderboardCategory property is automatically updated. For example, to preserve the player’s selections, you can read the leaderboardCategory property after the screen is dismissed, and set that value the next time you initialize the view controller.

See Also

Configuring the Game Center Controller’s Content

var viewState: GKGameCenterViewControllerState

The content displayed by the Game Center controller.

enum GKGameCenterViewControllerState

Possible values for the viewState property.

var leaderboardIdentifier: String?

The named leaderboard that is displayed by the view controller.

var leaderboardTimeScope: GKLeaderboard.TimeScope

A time filter used to restrict which scores are displayed to the player.