Initializer

init(leaderboardIdentifier:forPlayer:)

Returns an initialized score object for the specified leaderboard and player.

Declaration

init(leaderboardIdentifier identifier: String, forPlayer playerID: String)

Parameters

identifier

Identifies the leaderboard that the score is being sent to.

playerID

The identifier of the player who’s score is being initialized.

Return Value

An initialized score object, or nil if an error occurred.

Discussion

Your game explicitly allocates and initializes a score object using the designated player and current date when it needs to report a new score to Game Center.

See Also

Deprecated Methods and Properties

var category: String?

The leaderboard that this score belongs to.

Deprecated
func challengeComposeController(withPlayers: [String]?, message: String?, completionHandler: GKChallengeComposeCompletionBlock?) -> UIViewController?

Provides a challenge compose view controller with pre-selected player identifiers and a preformatted, player-editable message.

Deprecated
init(category: String?)

Returns an initialized score object.

Deprecated
func issueChallenge(toPlayers: [String]?, message: String?)

Issues a score challenge to a set of players.

Deprecated
var playerID: String

The player identifier for the player that earned the score.

Deprecated
func report(completionHandler: ((Error?) -> Void)?)

Reports a score to Game Center.

Deprecated