TechnologiesGames & 3D

GameKit

iOSmacOStvOSwatchOSvisionOS

GameKit connects your game to Game Center services for leaderboards, achievements, challenges, matchmaking, and the in-game access point widget. You authenticate the current player with GKLocalPlayer, post and read scores through GKLeaderboard, GKLeaderboardScore, and GKLeaderboardSet, and track progress with GKAchievement and GKAchievementDescription. Use GKChallenge types such as GKScoreChallenge and GKAchievementChallenge to send and receive challenges, and create real-time multiplayer sessions with GKMatch. Present built-in Game Center interfaces with GKGameCenterViewController, GKLeaderboardViewController, and GKAchievementViewController, and surface entry to Game Center through GKAccessPoint across iOS, macOS, tvOS, watchOS, and visionOS.

Players and Authentication 6

Identify and authenticate the local Game Center player and represent other participants.

  • Cl
    GKLocalPlayeriOS 4.1+
    An object that represents the authenticated player on the current device.
  • Cl
    GKPlayeriOS 4.1+
    An object that represents a player in a Game Center game.
  • Cl
    GKBasePlayeriOS 10.0+
    An abstract base class that represents a participant in a Game Center game.
  • Cl
    GKCloudPlayer
    An object that represents a player identified through their iCloud account.
  • Pr
    GKLocalPlayerListeneriOS 7.0+
    A protocol that receives Game Center events directed at the local player.
  • En
    GKFriendsAuthorizationStatusiOS 14.5+
    Constants that indicate the player's authorization to access friends.

Leaderboards and Scores 4

Post and read player scores across leaderboards and leaderboard sets.

  • Cl
    GKLeaderboardiOS 4.1+
    GKLeaderboard represents a single instance of a leaderboard for the current game.
  • Cl
    GKLeaderboardScoreiOS 14.0+
    A `GKLeaderboardScore` object represents a score on a leaderboard for scores you report for challenges or turn-based games.
  • Cl
    GKLeaderboardSetiOS 7.0+
    GKLeaderboardSet represents the sets that leaderboards can be broken out into.
  • Cl
    GKScore
    GKScore represents a score in the leaderboards.

Achievements 2

Track and describe the achievements a player earns while playing.

  • Cl
    GKAchievementiOS 4.1+
    An object that reports a player's progress toward completing a single achievement.
  • Cl
    GKAchievementDescriptioniOS 4.1+
    GKAchievementDescription is a full description of the achievement as defined before app submission in App Store Connect.

Challenges 8

Send and receive score and achievement challenges between players.

  • Cl
    GKChallenge
    An object that represents a challenge one player issues to another.
  • Cl
    GKScoreChallenge
    A challenge that asks another player to beat a leaderboard score.
  • Cl
    GKAchievementChallenge
    A challenge that asks another player to earn a specific achievement.
  • Cl
    GKChallengeDefinitioniOS 26.0+
    An object that defines the configuration and rules of a challenge.
  • Cl
    GKChallengeEventHandler
    A singleton object responsible for dispatching challenge-related events to its delegate
  • Pr
    GKChallengeListener
    A protocol that receives notifications about challenges the player sends or receives.
  • Pr
    GKChallengeEventHandlerDelegate
    GKChallengeEventHandler's delegate must implement the following protocol to be notified of challenge-related events. All of these methods are called on the main thread.
  • En
    GKChallengeState
    Constants that indicate the current state of a challenge.

Game Activity 4

Define and observe structured game activities that players engage in.

  • Cl
    GKGameActivityiOS 26.0+
    An object that represents a single instance of a game activity for the current game.
  • Cl
    GKGameActivityDefinitioniOS 26.0+
    An object that defines the configuration of a kind of game activity.
  • Pr
    GKGameActivityListeneriOS 26.0+
    A protocol that receives notifications about the player's game activities.
  • En
    GKGameActivityPlayStyleiOS 26.0+
    Play Style of the game activity. It can be either Asynchronous or Synchronous.

Real-Time Matchmaking 10

Find players and create and manage real-time multiplayer matches.

  • Cl
    GKMatchiOS 4.1+
    GKMatch represents an active networking sessions between players. It handles network communications and can report player connection status. All matches are created by a GKMatchmaker.
  • Cl
    GKMatchRequestiOS 4.1+
    GKMatchRequest represents the parameters needed to create the match.
  • Cl
    GKInviteiOS 4.1+
    GKInvite represents an accepted game invite, it is used to create a GKMatchmakerViewController
  • Cl
    GKMatchedPlayersiOS 17.2+
    An object that holds the players that the matchmaker found for a match.
  • Cl
    GKMatchmakeriOS 4.1+
    GKMatchmaker is a singleton object to manage match creation from invites and automatching.
  • Pr
    GKMatchDelegateiOS 4.0+
    A protocol that responds to data and connection events within a real-time match.
  • Pr
    GKInviteEventListeneriOS 7.0+
    GKInviteEventListener uses the GKLocalPlayerListener mechanism on GKLocalPlayer to listen to the two kinds of invite events that a game must respond to
  • En
    GKMatchTypeiOS 6.0+
    Constants that specify the kind of match to create.
  • En
    GKMatchmakingModeiOS 14.0+
    Constants that specify which players the matchmaker considers when finding a match.
  • En
    GKInviteRecipientResponseiOS 8.0+
    Possible invitee responses

Turn-Based Matches 8

Run and exchange data within asynchronous turn-based multiplayer games.

  • Cl
    GKTurnBasedMatchiOS 5.0+
    An object that manages the state and turns of an asynchronous multiplayer match.
  • Cl
    GKTurnBasedParticipantiOS 5.0+
    GKTurnBasedMatch represents an ongoing turn-based game among the matched group of participants
  • Cl
    GKTurnBasedExchangeiOS 7.0+
    An object that represents an out-of-turn data exchange between participants.
  • Cl
    GKTurnBasedExchangeReplyiOS 7.0+
    An object that represents a participant's reply to a turn-based exchange.
  • Cl
    GKTurnBasedEventHandler
    An object that delivers events for the player's turn-based matches.
  • Pr
    GKTurnBasedEventListeneriOS 7.0+
    A protocol that receives notifications about turn-based match events.
  • Pr
    GKTurnBasedEventHandlerDelegate
    A protocol that responds to events from the turn-based event handler.
  • En
    GKTurnBasedExchangeStatusiOS 7.0+
    Constants that indicate the status of a turn-based exchange.

Voice Chat 4

Add real-time voice communication between players in a match.

  • Cl
    GKVoiceChat
    GKVoiceChat represents an instance of a named voice communications channel
  • Cl
    GKVoiceChatService
    This a not a Game Center feature. To support voice chat as part of Game Center online play, see GKVoiceChat.
  • Pr
    GKVoiceChatClient
    A protocol that provides data and configuration for the legacy voice chat service.
  • St
    GKVoiceChatServiceError
    A structure that describes errors reported by the voice chat service.

Game Center Interface 15

Present the built-in Game Center interfaces and the in-game access point.

  • Cl
    GKAccessPointiOS 14.0+
    An object that displays an entry point to Game Center within your game's interface.
  • Cl
    GKGameCenterViewController
    View controller that provides the standard user interface for leaderboards, achievements, and challenges. Present modally from the top view controller.
  • Cl
    GKLeaderboardViewController
    View controller that provides the standard user interface for leaderboards. Present modally from the top view controller.
  • Cl
    GKAchievementViewController
    View controller that provides the standard user interface for achievements. Present modally from the top view controller.
  • Cl
    GKMatchmakerViewControlleriOS 4.1+
    A view controller that presents the standard interface for finding players and starting a match.
  • Cl
    GKTurnBasedMatchmakerViewControlleriOS 5.0+
    View controller to manage turn-based matches, invite friends and perform automatching. Present modally from the top view controller.
  • Cl
    GKFriendRequestComposeViewController
    Standard view controller for sending friend requests to other players. Present modally from the top view controller.
  • Cl
    GKNotificationBanner
    Asynchronously shows a notification banner like the one used for Game Center’s “Welcome Back” message.
  • Pr
    GKGameCenterControllerDelegate
    A protocol that responds to the dismissal of the Game Center interface.
  • Pr
    GKLeaderboardViewControllerDelegate
    A protocol that responds to the dismissal of the leaderboard interface.
  • Pr
    GKAchievementViewControllerDelegate
    Optional delegate
  • Pr
    GKMatchmakerViewControllerDelegateiOS 4.0+
    A protocol that responds to events from the matchmaker interface.
  • Pr
    GKTurnBasedMatchmakerViewControllerDelegateiOS 5.0+
    A protocol that responds to events from the turn-based matchmaker interface.
  • Pr
    GKFriendRequestComposeViewControllerDelegate
    Optional delegate
  • En
    GKGameCenterViewControllerStateiOS 6.0+
    Constants that specify which screen the Game Center interface initially shows.

Saved Games 5

Save and synchronize game progress to a player's iCloud account.

  • Cl
    GKSavedGameiOS 8.0+
    Class representing a saved game for the local player, or a version of a saved game when in conflict
  • Pr
    GKSavedGameListeneriOS 8.0+
    A protocol that receives notifications about changes to saved games.
  • Cl
    GKGameSession
    An object that manages shared game data among a group of players.
  • Pr
    GKGameSessionEventListener
    A protocol that receives events about changes to a shared game session.
  • St
    GKGameSessionError
    A structure that describes errors reported by shared game sessions.

Peer-to-Peer Sessions 12

Legacy peer-to-peer networking sessions and connection management.

  • Cl
    GKSession
    The GKSession handles networking between peers for a game, which includes establishing and maintaining connections over a game network, and network data transport.
  • Pr
    GKSessionDelegate
    Callbacks to the GKSession delegate.
  • Cl
    GKPeerPickerController
    This a not a Game Center feature. To support Game Center and online play, see GKMatchMatchmakerViewController.
  • Pr
    GKPeerPickerControllerDelegate
    A protocol that responds to events from the legacy peer picker.
  • St
    GKSessionError
    A structure that describes errors reported by legacy peer-to-peer sessions.
  • En
    GKSessionMode
    Constants that specify the role a peer plays in a legacy session.
  • En
    GKConnectionStateiOS 10.0+
    Constants that indicate the connection state of a peer in a session.
  • En
    GKTransportTypeiOS 10.0+
    Constants that specify how reliably data is transported in a session.
  • En
    GKSendDataMode
    Delivery options for GKSession's -(BOOL)sendData... methods.
  • En
    GKPeerConnectionState
    Specifies the type of peers to return in method -peersWithConnectionState:
  • En
    GKPeerPickerConnectionType
    Constants that specify the connection types the peer picker offers.
  • En
    GKPlayerConnectionStateiOS 4.0+
    Constants that indicate whether a player is connected to a match.

Errors and Status 2

Error domains and release-state values reported by Game Center operations.

  • St
    GKErroriOS 4.0+
    A structure that describes errors reported by Game Center.
  • St
    GKReleaseStateiOS 18.4+
    Describes the release state of an App Store Connect resource, such as an Achievement or Leaderboard.

Type Aliases 3

  • Ty
    GKChallengeComposeCompletionBlock
  • Ty
    GKChallengeComposeHandler
  • Ty
    GKInviteeResponse

Extends 1

NSNotification
← Games & 3D