---
title: GKChallengeEventHandler
framework: gamekit
role: symbol
role_heading: Class
path: gamekit/gkchallengeeventhandler
---

# GKChallengeEventHandler

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

## Declaration

```swift
class GKChallengeEventHandler
```

## Overview

Overview important: Your game must initialize a local player before you can use any Game Center classes. If there is no initialized player, your game receives a GKError.Code.notAuthenticated error. For more information, see Authenticating a player. To use it, call the challengeEventHandler class method to get the Singleton instance and assign an object that implements the GKChallengeEventHandlerDelegate protocol to its delegate property. You should assign a challenge event handler immediately after initializing the local player, because your game may have launched in response to a challenge notification being received by the player.

## Topics

### Getting and Setting the Delegate

- [delegate](gamekit/gkchallengeeventhandler/delegate.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Deprecated classes

- [GKAchievementViewController](gamekit/gkachievementviewcontroller.md)
- [GKChallengesViewController](gamekit/gkchallengesviewcontroller.md)
- [GKChallenge](gamekit/gkchallenge.md)
- [GKScoreChallenge](gamekit/gkscorechallenge.md)
- [GKAchievementChallenge](gamekit/gkachievementchallenge.md)
- [GKCloudPlayer](gamekit/gkcloudplayer.md)
- [GKGameCenterViewController](gamekit/gkgamecenterviewcontroller.md)
- [GKGameSession](gamekit/gkgamesession.md)
- [GKGameSessionSharingViewController](gamekit/gkgamesessionsharingviewcontroller.md)
- [GKFriendRequestComposeViewController](gamekit/gkfriendrequestcomposeviewcontroller.md)
- [GKLeaderboardViewController](gamekit/gkleaderboardviewcontroller.md)
- [GKPeerPickerController](gamekit/gkpeerpickercontroller.md)
- [GKScore](gamekit/gkscore.md)
- [GKSession](gamekit/gksession.md)
- [GKTurnBasedEventHandler](gamekit/gkturnbasedeventhandler.md)
