An object containing information for a score that was earned by the player.
- iOS 4.1+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Your game creates
GKScore objects to post scores to a leaderboard on Game Center. When your game retrieves score information from a leaderboard, those scores are returned as
Scores and leaderboards work together to help you create a better game. Whenever a new
GKScore object is created, it is associated with a leaderboard. You must ensure that the score being sent to a leaderboard is compatible with the leaderboard scoring format set in App Store Connect. See Leaderboards and Leaderboard Sets for information on how to create a leaderboard in App Store Connect.
To report a score to Game Center, your game allocates and initializes a new object, sets the
value property to the score the player earned, and then calls the
report(completion method. The mechanism your game uses to calculate scores is up to you to design; scores are only compared within your game.