Initializer

init(category:)

Returns an initialized score object.

Declaration

init(category: String?)

Parameters

category

An identifier for a specific leaderboard you’ve configured in App Store Connect. Must not be nil.

Return Value

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

Discussion

Your game explicitly allocates and initializes a score object 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(leaderboardIdentifier: String, forPlayer: String)

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

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