Instance Property

value

The score earned by the player.

Declaration

var value: Int64 { get set }

Discussion

You can use any algorithm you want to calculate scores in your game. Your game must set the value property before reporting a score, otherwise an error is returned.

The value provided by a score object is interpreted by Game Center only when formatted for display. You determine how your scores are formatted when you define the leaderboard in App Store Connect.

See Also

Score Properties

var context: UInt64

An integer value used by your game.

var date: Date

The date and time when the score was earned.

var formattedValue: String?

Returns the player’s score as a localized string.

var leaderboardIdentifier: String

The identifier for the leaderboard.

var player: GKPlayer

The player identifier for the player that earned the score.

var rank: Int

The position of the score in the results of a leaderboard search.