<!--
{
  "availability" : [
    "iOS: 6.0.0 - 7.0.0",
    "iPadOS: 6.0.0 - 7.0.0",
    "macOS: 10.8.0 - 10.10.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKChallengeEventHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKChallengeEventHandler"
  },
  "title" : "GKChallengeEventHandler"
}
-->

# GKChallengeEventHandler

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

```
class GKChallengeEventHandler
```

## 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 ``doc://com.apple.gamekit/documentation/GameKit/GKError/Code/notAuthenticated`` error. For more information, see <doc://com.apple.gamekit/documentation/GameKit/authenticating-a-player>.

To use it, call the [`challengeEventHandler`](/documentation/GameKit/GKChallengeEventHandler/challengeEventHandler) class method to get the [Singleton](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Singleton.html#//apple_ref/doc/uid/TP40008195-CH49) instance and assign an object that implements the [`GKChallengeEventHandlerDelegate`](/documentation/GameKit/GKChallengeEventHandlerDelegate) protocol to its [`delegate`](/documentation/GameKit/GKChallengeEventHandler/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

### Retrieving the Shared Instance

[`+  challengeEventHandler`](/documentation/GameKit/GKChallengeEventHandler/challengeEventHandler)

Returns the shared instance of the event handler

### Getting and Setting the Delegate

[`delegate`](/documentation/GameKit/GKChallengeEventHandler/delegate)

The delegate for the event handler.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)