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.
- ClGKLocalPlayeriOS 4.1+An object that represents the authenticated player on the current device.
- ClGKPlayeriOS 4.1+An object that represents a player in a Game Center game.
- ClGKBasePlayeriOS 10.0+An abstract base class that represents a participant in a Game Center game.
- ClGKCloudPlayerAn object that represents a player identified through their iCloud account.
- PrGKLocalPlayerListeneriOS 7.0+A protocol that receives Game Center events directed at the local player.
- EnGKFriendsAuthorizationStatusiOS 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.
- ClGKLeaderboardiOS 4.1+GKLeaderboard represents a single instance of a leaderboard for the current game.
- ClGKLeaderboardScoreiOS 14.0+A `GKLeaderboardScore` object represents a score on a leaderboard for scores you report for challenges or turn-based games.
- ClGKLeaderboardSetiOS 7.0+GKLeaderboardSet represents the sets that leaderboards can be broken out into.
- ClGKScoreGKScore represents a score in the leaderboards.
Achievements 2
Track and describe the achievements a player earns while playing.
- ClGKAchievementiOS 4.1+An object that reports a player's progress toward completing a single achievement.
- ClGKAchievementDescriptioniOS 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.
- ClGKChallengeAn object that represents a challenge one player issues to another.
- ClGKScoreChallengeA challenge that asks another player to beat a leaderboard score.
- ClGKAchievementChallengeA challenge that asks another player to earn a specific achievement.
- ClGKChallengeDefinitioniOS 26.0+An object that defines the configuration and rules of a challenge.
- ClGKChallengeEventHandlerA singleton object responsible for dispatching challenge-related events to its delegate
- PrGKChallengeListenerA protocol that receives notifications about challenges the player sends or receives.
- PrGKChallengeEventHandlerDelegateGKChallengeEventHandler's delegate must implement the following protocol to be notified of challenge-related events. All of these methods are called on the main thread.
- EnGKChallengeStateConstants that indicate the current state of a challenge.
Game Activity 4
Define and observe structured game activities that players engage in.
- ClGKGameActivityiOS 26.0+An object that represents a single instance of a game activity for the current game.
- ClGKGameActivityDefinitioniOS 26.0+An object that defines the configuration of a kind of game activity.
- PrGKGameActivityListeneriOS 26.0+A protocol that receives notifications about the player's game activities.
- EnGKGameActivityPlayStyleiOS 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.
- ClGKMatchiOS 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.
- ClGKMatchRequestiOS 4.1+GKMatchRequest represents the parameters needed to create the match.
- ClGKInviteiOS 4.1+GKInvite represents an accepted game invite, it is used to create a GKMatchmakerViewController
- ClGKMatchedPlayersiOS 17.2+An object that holds the players that the matchmaker found for a match.
- ClGKMatchmakeriOS 4.1+GKMatchmaker is a singleton object to manage match creation from invites and automatching.
- PrGKMatchDelegateiOS 4.0+A protocol that responds to data and connection events within a real-time match.
- PrGKInviteEventListeneriOS 7.0+GKInviteEventListener uses the GKLocalPlayerListener mechanism on GKLocalPlayer to listen to the two kinds of invite events that a game must respond to
- EnGKMatchTypeiOS 6.0+Constants that specify the kind of match to create.
- EnGKMatchmakingModeiOS 14.0+Constants that specify which players the matchmaker considers when finding a match.
- EnGKInviteRecipientResponseiOS 8.0+Possible invitee responses
Turn-Based Matches 8
Run and exchange data within asynchronous turn-based multiplayer games.
- ClGKTurnBasedMatchiOS 5.0+An object that manages the state and turns of an asynchronous multiplayer match.
- ClGKTurnBasedParticipantiOS 5.0+GKTurnBasedMatch represents an ongoing turn-based game among the matched group of participants
- ClGKTurnBasedExchangeiOS 7.0+An object that represents an out-of-turn data exchange between participants.
- ClGKTurnBasedExchangeReplyiOS 7.0+An object that represents a participant's reply to a turn-based exchange.
- ClGKTurnBasedEventHandlerAn object that delivers events for the player's turn-based matches.
- PrGKTurnBasedEventListeneriOS 7.0+A protocol that receives notifications about turn-based match events.
- PrGKTurnBasedEventHandlerDelegateA protocol that responds to events from the turn-based event handler.
- EnGKTurnBasedExchangeStatusiOS 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.
- ClGKVoiceChatGKVoiceChat represents an instance of a named voice communications channel
- ClGKVoiceChatServiceThis a not a Game Center feature. To support voice chat as part of Game Center online play, see GKVoiceChat.
- PrGKVoiceChatClientA protocol that provides data and configuration for the legacy voice chat service.
- StGKVoiceChatServiceErrorA 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.
- ClGKAccessPointiOS 14.0+An object that displays an entry point to Game Center within your game's interface.
- ClGKGameCenterViewControllerView controller that provides the standard user interface for leaderboards, achievements, and challenges. Present modally from the top view controller.
- ClGKLeaderboardViewControllerView controller that provides the standard user interface for leaderboards. Present modally from the top view controller.
- ClGKAchievementViewControllerView controller that provides the standard user interface for achievements. Present modally from the top view controller.
- ClGKMatchmakerViewControlleriOS 4.1+A view controller that presents the standard interface for finding players and starting a match.
- ClGKTurnBasedMatchmakerViewControlleriOS 5.0+View controller to manage turn-based matches, invite friends and perform automatching. Present modally from the top view controller.
- ClGKFriendRequestComposeViewControllerStandard view controller for sending friend requests to other players. Present modally from the top view controller.
- ClGKNotificationBannerAsynchronously shows a notification banner like the one used for Game Center’s “Welcome Back” message.
- PrGKGameCenterControllerDelegateA protocol that responds to the dismissal of the Game Center interface.
- PrGKLeaderboardViewControllerDelegateA protocol that responds to the dismissal of the leaderboard interface.
- PrGKAchievementViewControllerDelegateOptional delegate
- PrGKMatchmakerViewControllerDelegateiOS 4.0+A protocol that responds to events from the matchmaker interface.
- PrGKTurnBasedMatchmakerViewControllerDelegateiOS 5.0+A protocol that responds to events from the turn-based matchmaker interface.
- PrGKFriendRequestComposeViewControllerDelegateOptional delegate
- EnGKGameCenterViewControllerStateiOS 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.
- ClGKSavedGameiOS 8.0+Class representing a saved game for the local player, or a version of a saved game when in conflict
- PrGKSavedGameListeneriOS 8.0+A protocol that receives notifications about changes to saved games.
- ClGKGameSessionAn object that manages shared game data among a group of players.
- PrGKGameSessionEventListenerA protocol that receives events about changes to a shared game session.
- StGKGameSessionErrorA structure that describes errors reported by shared game sessions.
Peer-to-Peer Sessions 12
Legacy peer-to-peer networking sessions and connection management.
- ClGKSessionThe GKSession handles networking between peers for a game, which includes establishing and maintaining connections over a game network, and network data transport.
- PrGKSessionDelegateCallbacks to the GKSession delegate.
- ClGKPeerPickerControllerThis a not a Game Center feature. To support Game Center and online play, see GKMatchMatchmakerViewController.
- PrGKPeerPickerControllerDelegateA protocol that responds to events from the legacy peer picker.
- StGKSessionErrorA structure that describes errors reported by legacy peer-to-peer sessions.
- EnGKSessionModeConstants that specify the role a peer plays in a legacy session.
- EnGKConnectionStateiOS 10.0+Constants that indicate the connection state of a peer in a session.
- EnGKTransportTypeiOS 10.0+Constants that specify how reliably data is transported in a session.
- EnGKSendDataModeDelivery options for GKSession's -(BOOL)sendData... methods.
- EnGKPeerConnectionStateSpecifies the type of peers to return in method -peersWithConnectionState:
- EnGKPeerPickerConnectionTypeConstants that specify the connection types the peer picker offers.
- EnGKPlayerConnectionStateiOS 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.
- StGKErroriOS 4.0+A structure that describes errors reported by Game Center.
- StGKReleaseStateiOS 18.4+Describes the release state of an App Store Connect resource, such as an Achievement or Leaderboard.
Type Aliases 3
- TyGKChallengeComposeCompletionBlock
- TyGKChallengeComposeHandler
- TyGKInviteeResponse