Protocol

GKChallengeEventHandlerDelegate

You implement the GKChallengeEventHandlerDelegate delegate to control how challenges are displayed in your game.

Declaration

protocol GKChallengeEventHandlerDelegate

Overview

By default, Game Kit briefly displays a banner over your game when any of the following events occur:

  • The local player receives a challenge.

  • The local player completes a challenge.

  • A remote player completes a challenge issued by the local player.

Your event handler can override or extend this behavior:

  • It can prevent a banner from being displayed.

  • It can be notified when a player taps in a banner.

  • It can handle the events directly.

Topics

Detecting When a User Taps a Banner

func localPlayerDidSelect(GKChallenge!)

Called when the local player selects a challenge banner displayed by Game Kit.

Responding When a New Challenge is Received

func localPlayerDidReceive(GKChallenge!)

Called when the local player receives a new challenge.

func shouldShowBanner(forLocallyReceivedChallenge: GKChallenge!) -> Bool

Called to determine whether a banner should be shown when the local player receives a challenge.

Responding to Challenges Completed By the Local Player

func localPlayerDidComplete(GKChallenge!)

Called when the local player completes a challenge.

func shouldShowBanner(forLocallyCompletedChallenge: GKChallenge!) -> Bool

Called to determine whether a banner should be shown when the local player completes a challenge.

Responding to Challenges Issued by the Local Player

func remotePlayerDidComplete(GKChallenge!)

Called when a remote player completes a challenge issued by the local player.

func shouldShowBanner(forRemotelyCompletedChallenge: GKChallenge!) -> Bool

Called to determine whether a banner should be shown when a remote player completes a challenge.

Relationships

Inherits From

See Also

Challenge Events and View Controllers

class GKChallengeEventHandler

The GKChallengeEventHandler class is used to respond to events related to challenges sent or received by the local player.

Deprecated