---
title: leaderboardIdentifier
framework: gamekit
role: symbol
role_heading: Instance Property
path: gamekit/gkgamecenterviewcontroller/leaderboardidentifier
---

# leaderboardIdentifier

The named leaderboard that the view controller displays.

## Declaration

```swift
var leaderboardIdentifier: String? { get set }
```

## Discussion

Discussion The leaderboardIdentifier property must either be nil or it must match a leaderboard 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 leaderboardIdentifier property is automatically updated. For example, to preserve the player’s selections, you can read the leaderboardIdentifier property after the screen is dismissed, and set that value the next time you initialize the view controller.

## See Also

### Deprecated Properties

- [viewState](gamekit/gkgamecenterviewcontroller/viewstate.md)
- [leaderboardCategory](gamekit/gkgamecenterviewcontroller/leaderboardcategory.md)
- [leaderboardTimeScope](gamekit/gkgamecenterviewcontroller/leaderboardtimescope.md)
