Instance Property

value

The score earned by the player.

Declaration

iOS, Mac Catalyst, tvOS, watchOS
@property(assign, nonatomic) int64_t value;
macOS
@property(assign, atomic) int64_t value;

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

context

An integer value used by your game.

date

The date and time when the score was earned.

formattedValue

Returns the player’s score as a localized string.

leaderboardIdentifier

The identifier for the leaderboard.

player

The player identifier for the player that earned the score.

rank

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