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

# GKChallenge

A challenge issued by the local player to another player.

```
class GKChallenge
```

## Overview

Players can use Game Center to challenge other players to beat their scores and achievements that they earn in your game. When a player issues a challenge to another player, Game Center sends a push notification to the other player. That player can then accept or refuse the challenge. If the player accepts the challenge, Game Center adds the challenge to the player’s list of challenges. Later, if the player beats the challenge, Game Center notifies both players.

Game Center supports two kinds of challenges:

- score challenge ([`GKScoreChallenge`](/documentation/GameKit/GKScoreChallenge)): When a player challenges another player to beat their leaderboard score. When the player beats the score, Game Center issues a new score challenge to the player who initiated the challenge and continues issuing challenges between the players until a player refuses the challenge.
- achievement challenge ([`GKAchievementChallenge`](/documentation/GameKit/GKAchievementChallenge)): When a player challenges another player to earn an achievement. This challenge ends when the player earns the achievement.

You never subclass the [`GKChallenge`](/documentation/GameKit/GKChallenge) class directly. However, you can subclass [`GKScoreChallenge`](/documentation/GameKit/GKScoreChallenge) or [`GKAchievementChallenge`](/documentation/GameKit/GKAchievementChallenge) to create specific kinds of challenges.

### Enable Challenges

You must enable challenges for your game in App Store Connect before you can use the challenges features. For details, see [Enable challenges](https://developer.apple.com/help/app-store-connect/configure-game-center/enable-challenges/) in App Store Connect Help.

### Load and Issue Challenges

You can load the challenges issued by the local player using the [`loadReceivedChallenges(completionHandler:)`](/documentation/GameKit/GKChallenge/loadReceivedChallenges(completionHandler:)) class method. You can issue challenges with the player’s permission using the [`challengeComposeController(withMessage:players:completion:)`](/documentation/GameKit/GKScore/challengeComposeController(withMessage:players:completion:)) method in the [`GKLeaderboard.Entry`](/documentation/GameKit/GKLeaderboard/Entry), [`GKScore`](/documentation/GameKit/GKScore), or [`GKAchievement`](/documentation/GameKit/GKAchievement) class.

## Topics

### Retrieving the List of Challenges to the Local Player

[`+  loadReceivedChallengesWithCompletionHandler:`](/documentation/GameKit/GKChallenge/loadReceivedChallenges(completionHandler:))

Loads the list of outstanding challenges.

### Examining Details about a Challenge

[`issuingPlayer`](/documentation/GameKit/GKChallenge/issuingPlayer)

The player who issues the challenge.

[`receivingPlayer`](/documentation/GameKit/GKChallenge/receivingPlayer)

The player who receives the challenge.

[`message`](/documentation/GameKit/GKChallenge/message)

A text message that describes the challenge.

[`state`](/documentation/GameKit/GKChallenge/state)

The current state of the challenge.

[`GKChallengeState`](/documentation/GameKit/GKChallengeState)

The state of a challenge.

[`issueDate`](/documentation/GameKit/GKChallenge/issueDate)

The date the player issued the challenge.

[`completionDate`](/documentation/GameKit/GKChallenge/completionDate)

The date the challenged player completed the challenge.

### Declining a Challenge

[`-  decline`](/documentation/GameKit/GKChallenge/decline())

Declines a challenge that another player issues to the local player.

### Deprecated symbols

[`issuingPlayerID`](/documentation/GameKit/GKChallenge/issuingPlayerID)

The player who issues the challenge.

[`receivingPlayerID`](/documentation/GameKit/GKChallenge/receivingPlayerID)

The player who receives the challenge.

[`GKChallengeComposeCompletionBlock`](/documentation/GameKit/GKChallengeComposeCompletionBlock)

A completion block that provides information about the player who issues a challenge and the players who receive it.

## Relationships

### Inherited By

[`GKAchievementChallenge`](/documentation/GameKit/GKAchievementChallenge)

[`GKScoreChallenge`](/documentation/GameKit/GKScoreChallenge)

### Conforms To

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

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

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

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

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

[`NSCoding`](/documentation/Foundation/NSCoding)

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

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

### 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)