challengeComposeController(withMessage:players:completionHandler:)
Provides a challenge compose view controller with preselected player identifiers and a preformatted, player-editable message.
Declaration
func challengeComposeController(withMessage message: String?, players: [GKPlayer]?, completionHandler: GKChallengeComposeCompletionBlock? = nil) -> UIViewControllerfunc challengeComposeController(withMessage message: String?, players: [GKPlayer]?, completionHandler: GKChallengeComposeCompletionBlock? = nil) -> NSViewControllerParameters
- message:
The preformatted, player-editable message that GameKit sends to the players in the challenge.
- players:
Players to invite to the challenge.
- completionHandler:
A block that GameKit calls after it displays the view controller.
Return Value
A UIViewController containing the player identifiers and a player-editable message.
Discussion
GameKit presents the returned view controller modally on the top view controller. After GameKit displays the view controller and the player sends or cancels the challenge, GameKit calls the completion handler block on the main thread.