Instance Property

formattedValue

Returns the player’s score as a localized string.

Declaration

iOS, Mac Catalyst, tvOS, watchOS
@property(readonly, copy, nonatomic) NSString *formattedValue;
macOS
@property(readonly, copy, atomic) NSString *formattedValue;

Discussion

This property is invalid on a newly initialized score object. On a score returned from GameKit, it contains a formatted string based on the player’s score. You determine how a score is formatted when you define the leaderboard in App Store Connect.

Never convert the value property into a string directly; always use this method to receive the formatted string.

See Also

Score Properties

context

An integer value used by your game.

date

The date and time when the score was earned.

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.

value

The score earned by the player.