GKLeaderboard class provides a standard user interface that displays leaderboard scores to the player. If the
GKGame class is available, you should use it instead.
- iOS 4.1–7.0Deprecated
- macOS 10.8–10.10Deprecated
- Mac Catalyst 13.0–13.0Deprecated
To show a leaderboard screen, initialize a new
GKLeaderboard object and set the delegate. Optionally, you can configure the view controller to display specific data to the player. Then, present the new view controller and wait for the delegate to be called. Once the delegate is called, dismiss the view controller.
On iOS, you present and dismiss the view controller from another view controller in your game, using the methods provided by the
UIView class. In macOS, you use the
GKDialog class to present and dismiss the view controller.
Your game should pause other activities before presenting the leaderboard.
GKLeaderboard class is not intended to be subclassed.