GKChallengeEventHandlerDelegate Protocol Reference
| Conforms to | |
| Framework | /System/Library/Frameworks/GameKit.framework |
| Availability | Available in iOS 6.0 and later. |
| Companion guide | |
| Declared in | GKChallengeEventHandler.h |
Overview
You implement the GKChallengeEventHandlerDelegate delegate to control how challenges are displayed in your game.
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.
Tasks
Detecting When a User Taps a Banner
Responding When a New Challenge Is Received
Responding to Challenges Completed By the Local Player
Responding to Challenges Issued by the Local Player
Instance Methods
localPlayerDidCompleteChallenge:
Called when the local player completes a challenge.
Parameters
- challenge
The completed challenge.
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.hlocalPlayerDidReceiveChallenge:
Called when the local player receives a new challenge.
Parameters
- challenge
The received challenge.
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.hlocalPlayerDidSelectChallenge:
Called when the local player selects a challenge banner displayed by Game Kit.
Parameters
- challenge
The selected challenge.
Discussion
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.hremotePlayerDidCompleteChallenge:
Called when a remote player completes a challenge issued by the local player.
Parameters
- challenge
The completed challenge.
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.hshouldShowBannerForLocallyCompletedChallenge:
Called to determine whether a banner should be shown when the local player completes a challenge.
Parameters
- challenge
The completed challenge.
Return Value
Your delegate should return YES if it wants a banner to be displayed. Otherwise it should return NO.
Discussion
If you do not implement this method, a banner is always shown.
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.hshouldShowBannerForLocallyReceivedChallenge:
Called to determine whether a banner should be shown when the local player receives a challenge.
Parameters
- challenge
The received challenge.
Return Value
Your delegate should return YES if it wants a banner to be displayed. Otherwise it should return NO.
Discussion
If you do not implement this method, a banner is always shown.
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.hshouldShowBannerForRemotelyCompletedChallenge:
Called to determine whether a banner should be shown when a remote player completes a challenge.
Parameters
- challenge
The completed challenge.
Return Value
Your delegate should return YES if it wants a banner to be displayed. Otherwise it should return NO.
Discussion
If you do not implement this method, a banner is always shown.
Availability
- Available in iOS 6.0 and later.
Declared In
GKChallengeEventHandler.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)