Initializer

init(identifier:forPlayer:)

Initializes an achievement for a specific player.

Declaration

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

Parameters

identifier

A string that matches the identifier string for an achievement you created for your game in App Store Connect.

player_ID

The identifier for the player associated with the specified achievement.

Discussion

Your game initializes a new achievement object for a specific player only when it has not previously reported progress for that achievement. Use this method to submit a participant’s achievement when ending a turn-based match.

See Also

Deprecated Methods and Properties

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

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

Deprecated
var isHidden: Bool

A Boolean value that states whether this achievement is normally kept secret from the player.

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

Issue an achievement challenge to a list of players.

Deprecated
var playerID: String

A string used to identify the player who earned the achievement.

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

Reports the player’s progress to Game Center.

Deprecated
func selectChallengeablePlayerIDs([String]?, withCompletionHandler: (([String]?, Error?) -> Void)?)

Finds the subset of players that can earn an achievement.

Deprecated