GameKit
The framework behind Game Center: players, leaderboards, achievements and multiplayer.
Introduced
2009
iPhone OS 3
Kind
Framework
Runs on
Get it from
iOS
3.0+
iPadOS
3.0+
Mac Catalyst
13.1+
macOS
10.8+
tvOS
9.0+
visionOS
1.0+
watchOS
3.0+
Overview
GameKit is how your game talks to Game Center. Authenticate the player, submit scores, unlock achievements, run challenges, and set up real-time or turn-based multiplayer with friends.
The same API works on iPhone, iPad, Mac, Apple TV, Apple Watch and Apple Vision Pro.
Authentication
Sign players in with their Game Center identity.
Leaderboards
Recurring and classic leaderboards with friend notifications.
Achievements
Unlockable goals with progress and rarity.
Multiplayer
Real-time and turn-based matches with friends.
Leaderboard.swift
import GameKit
GKLocalPlayer.local.authenticateHandler = { viewController, error in
// Present viewController if one is returned
}
func submit(score: Int) async throws {
try await GKLeaderboard.submitScore(
score,
context: 0,
player: GKLocalPlayer.local,
leaderboardIDs: ["daily.highscore"]
)
}
History
How it grew up.
2009
Introduced
Peer-to-peer connectivity in iPhone OS 3.
2010
Game Center
GameKit becomes the Game Center API.
2020
Access point
Game Center comes inside your game.