Instance Property

context

An integer value used by your game.

Declaration

var context: UInt64 { get set }

Discussion

The context property is stored and returned to your game, but is otherwise ignored by Game Center. It allows your game to associate an arbitrary 64-bit unsigned integer value with the score data reported to Game Center. You decide how this integer value is interpreted by your game. For example, you might use the context property to store flags that provide game-specific details about a player’s score, or you might use the context as a key to other data stored on the device or on your own server. The context is most useful when your game displays a custom leaderboard user interface.

See Also

Score Properties

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.

var value: Int64

The score earned by the player.