Instance Method

issueChallenge(toPlayers:message:)

Issue an achievement challenge to a list of players.

Declaration

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

Parameters

playerIDs

An array of NSString objects containing the player identifiers of the players being challenged.

message

A text message to display to the challenged players.

Discussion

This method should be used only to implement your own custom challenge user interface. You should only issue challenges when the local player directs you to do so.

If the achievement is marked as hidden in App Store Connect, or if the challenged player has already earned the achievement and it is not marked as replayable, then the challenge is not issued.

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
init(identifier: String?, forPlayer: String)

Initializes an achievement for a specific player.

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