Contents

GKScore

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

Declaration

class GKScore

Overview

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 GKScore objects.

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(completionHandler:) method. The mechanism your game uses to calculate scores is up to you to design; scores are only compared within your game.

Topics

Reporting a New Score

Issuing a Score Challenge

Deprecated Methods and Properties

Initializers

See Also

Deprecated classes