---
title: GKChallenge
framework: gamekit
role: symbol
role_heading: Class
path: gamekit/gkchallenge
---

# GKChallenge

A challenge issued by the local player to another player.

## Declaration

```swift
class GKChallenge
```

## Overview

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: You never subclass the GKChallenge class directly. However, you can subclass GKScoreChallenge or 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 in App Store Connect Help. Load and Issue Challenges You can load the challenges issued by the local player using the loadReceivedChallenges(completionHandler:) class method. You can issue challenges with the player’s permission using the challengeComposeController(withMessage:players:completion:) method in the GKLeaderboard.Entry, GKScore, or GKAchievement class.

## Topics

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

- [loadReceivedChallenges(completionHandler:)](gamekit/gkchallenge/loadreceivedchallenges(completionhandler:).md)

### Examining Details about a Challenge

- [issuingPlayer](gamekit/gkchallenge/issuingplayer.md)
- [receivingPlayer](gamekit/gkchallenge/receivingplayer.md)
- [message](gamekit/gkchallenge/message.md)
- [state](gamekit/gkchallenge/state.md)
- [GKChallengeState](gamekit/gkchallengestate.md)
- [issueDate](gamekit/gkchallenge/issuedate.md)
- [completionDate](gamekit/gkchallenge/completiondate.md)

### Declining a Challenge

- [decline()](gamekit/gkchallenge/decline().md)

### Deprecated symbols

- [issuingPlayerID](gamekit/gkchallenge/issuingplayerid.md)
- [receivingPlayerID](gamekit/gkchallenge/receivingplayerid.md)
- [GKChallengeComposeCompletionBlock](gamekit/gkchallengecomposecompletionblock.md)

### Initializers

- [init(coder:)](gamekit/gkchallenge/init(coder:).md)

## Relationships

### Inherits From

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

### Inherited By

- [GKAchievementChallenge](gamekit/gkachievementchallenge.md)
- [GKScoreChallenge](gamekit/gkscorechallenge.md)

### Conforms To

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

## See Also

### Deprecated classes

- [GKAchievementViewController](gamekit/gkachievementviewcontroller.md)
- [GKChallengeEventHandler](gamekit/gkchallengeeventhandler.md)
- [GKChallengesViewController](gamekit/gkchallengesviewcontroller.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)
