
Gamekit
Wire Game Center authentication, leaderboards, achievements, and multiplayer into a Swift iOS game without guessing GameKit lifecycle APIs.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill gamekitWhat is this skill?
- GKLocalPlayer authenticateHandler setup early in app lifecycle
- Leaderboards, achievements, challenges, and saved games patterns
- Real-time and turn-based multiplayer matchmaking sections
- Access Point and Game Center dashboard presentation guidance
- Dedicated Common Mistakes and Review Checklist before ship
Adoption & trust: 1.2k installs on skills.sh; 713 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Vercel React Native Skillsvercel-labs/agent-skills
Firebase Basicsfirebase/agent-skills
Building Native Uiexpo/skills
Firebase Ai Logic Basicsfirebase/agent-skills
Native Data Fetchingexpo/skills
Firebase Firestorefirebase/agent-skills
Journey fit
Primary fit
GameKit is an Apple platform integration tackled while building the game client, not during distribution or analytics phases. Game Center is an external service integration—auth handlers, leaderboard submission, and matchmaking—layered onto the iOS app target.
Common Questions / FAQ
Is Gamekit safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Gamekit
# GameKit Integrate Game Center features into iOS 26+ games using GameKit and Swift 6.3. Provides player authentication, leaderboards, achievements, multiplayer matchmaking, access point, dashboard, challenges, and saved games. ## Contents - [Authentication](#authentication) - [Access Point](#access-point) - [Dashboard](#dashboard) - [Leaderboards](#leaderboards) - [Achievements](#achievements) - [Real-Time Multiplayer](#real-time-multiplayer) - [Turn-Based Multiplayer](#turn-based-multiplayer) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Authentication All GameKit features require the local player to authenticate first. Set the `authenticateHandler` on `GKLocalPlayer.local` early in the app lifecycle. GameKit calls the handler multiple times during initialization. ```swift import GameKit func authenticatePlayer() { GKLocalPlayer.local.authenticateHandler = { viewController, error in if let viewController { // Present so the player can sign in or create an account. present(viewController, animated: true) return } if let error { // Player could not sign in. Disable Game Center features. disableGameCenter() return } // Player authenticated. Check restrictions before starting. let player = GKLocalPlayer.local if player.isUnderage { hideExplicitContent() } if player.isMultiplayerGamingRestricted { disableMultiplayer() } if player.isPersonalizedCommunicationRestricted { disableInGameChat() } configureAccessPoint() } } ``` Guard on `GKLocalPlayer.local.isAuthenticated` before calling any GameKit API. For server-side identity verification, see [references/gamekit-patterns.md](references/gamekit-patterns.md). ## Access Point `GKAccessPoint` displays a Game Center control in a corner of the screen. When tapped, it opens the Game Center dashboard. Configure it after authentication. ```swift func configureAccessPoint() { GKAccessPoint.shared.location = .topLeading GKAccessPoint.shared.showHighlights = true GKAccessPoint.shared.isActive = true } ``` Hide the access point during gameplay and show it on menu screens: ```swift GKAccessPoint.shared.isActive = false // Hide during active gameplay GKAccessPoint.shared.isActive = true // Show on pause or menu ``` Open the dashboard to a specific state programmatically: ```swift // Open directly to a leaderboard GKAccessPoint.shared.trigger( leaderboardID: "com.mygame.highscores", playerScope: .global, timeScope: .allTime ) { } // Open directly to achievements GKAccessPoint.shared.trigger(state: .achievements) { } ``` ## Dashboard Present the Game Center dashboard using `GKGameCenterViewController`. The presenting object must conform to `GKGameCenterControllerDelegate`. ```swift final class GameViewController: UIViewController, GKGameCenterControllerDelegate { func showDashboard() { let vc = GKGameCenterViewController(state: .dashboard) vc.gameCenterDelegate = self present(vc, animated: true) } func showLeaderboard(_ leaderboardID: String) { let vc = GKGameCenterViewController( leaderboardID: leaderboardID, playerScope: .global, timeScope: .allTime ) vc.gameCenterDelegate = self present(vc, animated: true) } func gameCenterViewControllerDidFinish( _ gameCenterViewController: GKGameCenterVie