Framework

GameKit

Create experiences that keep players coming back to your game. Add leaderboards, achievements, matchmaking, challenges, and more.

Overview

GameKit offers features that you can use to create great social games.

GameKit Features

GameKit provides you with the ability to create apps that allow players to interact with each other. Multiplayer apps allow your game to create real-time network matches. Players can invite other players to join their game. Most importantly, players can receive invitations to join a match even when your game is not running. Your game is running on each device and the instances of your game exchange match and voice data with each other. Turn-Based Gaming provides store-and-forward network match infrastructure where the match is played out over a series of discrete turns. This kind of match can be played without requiring all of the players to be connected simultaneously.

Game Center offers a centralized game service that connects players to each other. Game Center implements many different features:

  • Achievements provide the ability to track a player’s accomplishments in your game.

  • Leaderboards allow your game to store and fetch player scores from Game Center.

  • Challenges allow a player to challenge other players to complete an achievement or to beat a leaderboard score.

Topics

Players

class GKCloudPlayer

The object representing the currently signed-in iCloud user.

class GKLocalPlayer

An object representing the authenticated Game Center player on a device.

class GKPlayer

An object that provides information about a player on Game Center.

class GKBasePlayer

The top-level player object containing basic identifying information for a player.

protocol GKLocalPlayerListener

A protocol that handles events for Game Center accounts.

protocol GKInviteEventListener

A protocol that handles invite events from Game Center.

Leaderboards

class GKLeaderboard

An object used to read data from a leaderboard stored on Game Center.

class GKLeaderboardSet

An object that organizes leaderboards into logical and coherent groups.

class GKScore

An object containing information for a score that was earned by the player.

Achievements

class GKAchievement

An object that communicates with Game Center about the local player’s progress toward completing an achievement.

class GKAchievementDescription

An object holding text and images used to describe an achievement for an app.

Challenges

class GKChallenge

An object representing a challenge issued by the local player to another player.

class GKScoreChallenge

An object representing a challenge based on a score in a leaderboard.

class GKAchievementChallenge

A challenge sent to another player urging them to complete a specific achievement.

protocol GKChallengeListener

An object that responds to challenge events.

View Controllers

class GKGameCenterViewController

A single user interface used to display achievements and leaderboards supported by Game Center.

class GKDialogController

An object that provides the ability to present Game Center view controller classes in macOS.

protocol GKViewController

The abstract base protocol adopted by Game Center view controller classes.

Turn-based Games

class GKTurnBasedMatch

An object used to implement turn-based matches between sets of players on Game Center.

class GKTurnBasedExchange

The exchange information sent between players even when a player is not the current player.

class GKTurnBasedExchangeReply

The player’s response to an exchange.

class GKTurnBasedParticipant

The information that describes a participant in a turn-based match.

protocol GKTurnBasedEventListener

The protocol you implement to handle exchanges and match-related events for turn-based games.

Real-Time Matches

class GKMatch

A peer-to-peer network between a group of devices that are connected to Game Center.

class GKMatchRequest

A set of parameters for a new live or turn-based match.

class GKVoiceChat

A voice channel that allows a set of players in a match to speak with each other.

Player Invitations

class GKMatchmaker

An object that programmatically creates matches with other players and receives match invitations sent by other players.

class GKMatchmakerViewController

A user interface for inviting friends to a match or for allowing Game Center to fill the remaining players needed for a match.

class GKTurnBasedMatchmakerViewController

A user interface that allows players to manage the turn-based matches that they are participating in.

class GKInvite

A matchmaking invitation sent by another player to the local player.

Notifications

class GKNotificationBanner

A notification banner that displays text to the player.

Save Game Data

class GKSavedGame

The saved game data.

protocol GKSavedGameListener

The protocol you implement to provide custom actions when a saved game file is modified or a conflict is found.

Game Sessions

class GKGameSession

A game session you can use to save game data, invite other players, and create turn-based and real-time game apps.

protocol GKGameSessionEventListener

An event listener that handles game session events.

class GKGameSessionSharingViewController

A user interface you can use to invite other users into a tvOS game session.

Errors

struct GKError

Error codes for the GKError domain.

struct GKGameSessionError

Error codes for the GKGameSession domain.

Deprecated Symbols

Deprecated Symbols

GameKit APIs that have been deprecated and are no longer supported.

See Also