Contents

challengeComposeController(withMessage:players:completion:)

Provides a view controller that you present to the player to issue an achievement challenge.

Declaration

func challengeComposeController(withMessage message: String?, players: [GKPlayer], completion completionHandler: GKChallengeComposeHandler? = nil) -> UIViewController
func challengeComposeController(withMessage message: String?, players: [GKPlayer], completion completionHandler: GKChallengeComposeHandler? = nil) -> NSViewController

Parameters

  • message:

    The challenge message, which the player can edit before GameKit sends it to other players.

  • players:

    The players to invite to the challenge.

  • completionHandler:

    A block that GameKit calls after it displays the view controller.

Discussion

This method presents the view controller modally from the top view controller. GameKit calls the completion handler block after it displays the view controller and the player sends or cancels the challenge.

See Also

Issuing Achievement Challenges