---
title: GKLocalPlayer
framework: gamekit
role: symbol
role_heading: Class
path: gamekit/gklocalplayer
---

# GKLocalPlayer

The local player who signs in to Game Center on the device running the game.

## Declaration

```swift
class GKLocalPlayer
```

## Mentioned in

Authenticating a player Initializing and configuring Game Center Protecting the player’s privacy using scoped identifiers

## Overview

Overview Only one player can sign in to Game Center on a device at a time and that player is the local player. Before you can start a game that uses GameKit features, verify that the local player signs in to their Game Center account. You set the handler of the local player shared instance using the authenticateHandler property. Then implement this method to handle the multiple times GameKit invokes it during the sign-in process. If the local player needs to create an account or sign in, GameKit provides a view controller that you present to the local player. If the local player successfully signs in, determine whether they have any account restrictions and adjust your game accordingly. For more information about the initialization of the local player, see Authenticating a player. After the local player signs in, their account data and GameKit features are available. You can display the local player’s nickname and avatar, access their recent players and friends, and load their leaderboards and achievements. You can also register a listener object that GameKit calls when the local player sends or accepts invitations to play with others.

## Topics

### Accessing the Local Player

- [local](gamekit/gklocalplayer/local-oaa8.md)

### Authenticating the Local Player

- [authenticateHandler](gamekit/gklocalplayer/authenticatehandler.md)
- [isAuthenticated](gamekit/gklocalplayer/isauthenticated.md)
- [fetchItems(forIdentityVerificationSignature:)](gamekit/gklocalplayer/fetchitems(foridentityverificationsignature:).md)
- [GKPlayerAuthenticationDidChangeNotificationName](foundation/nsnotification/name-swift.struct/gkplayerauthenticationdidchangenotificationname.md)

### Determining Whether the Player Is Underage or Restricted

- [isUnderage](gamekit/gklocalplayer/isunderage.md)
- [isMultiplayerGamingRestricted](gamekit/gklocalplayer/ismultiplayergamingrestricted.md)
- [isPersonalizedCommunicationRestricted](gamekit/gklocalplayer/ispersonalizedcommunicationrestricted.md)

### Accessing Friends and Recents

- [loadFriendsAuthorizationStatus(_:)](gamekit/gklocalplayer/loadfriendsauthorizationstatus(_:).md)
- [GKFriendsAuthorizationStatus](gamekit/gkfriendsauthorizationstatus.md)
- [loadFriends(_:)](gamekit/gklocalplayer/loadfriends(_:).md)
- [loadFriends(identifiedBy:completionHandler:)](gamekit/gklocalplayer/loadfriends(identifiedby:completionhandler:).md)
- [NSGKFriendListUsageDescription](bundleresources/information-property-list/nsgkfriendlistusagedescription.md)
- [loadChallengableFriends(completionHandler:)](gamekit/gklocalplayer/loadchallengablefriends(completionhandler:).md)
- [loadRecentPlayers(completionHandler:)](gamekit/gklocalplayer/loadrecentplayers(completionhandler:).md)

### Adding Friends

- [isPresentingFriendRequestViewController](gamekit/gklocalplayer/ispresentingfriendrequestviewcontroller.md)
- [presentFriendRequestCreator(from:)](gamekit/gklocalplayer/presentfriendrequestcreator(from:)-7j1kn.md)
- [presentFriendRequestCreator(from:)](gamekit/gklocalplayer/presentfriendrequestcreator(from:)-7clh6.md)

### Working with Leaderboards

- [loadDefaultLeaderboardIdentifier(completionHandler:)](gamekit/gklocalplayer/loaddefaultleaderboardidentifier(completionhandler:).md)
- [setDefaultLeaderboardIdentifier(_:completionHandler:)](gamekit/gklocalplayer/setdefaultleaderboardidentifier(_:completionhandler:).md)

### Registering Listeners

- [register(_:)](gamekit/gklocalplayer/register(_:).md)
- [unregisterAllListeners()](gamekit/gklocalplayer/unregisteralllisteners().md)
- [unregisterListener(_:)](gamekit/gklocalplayer/unregisterlistener(_:).md)

### Saving Game Data

- [Saving the player’s game data to an iCloud account](gamekit/saving-the-player-s-game-data-to-an-icloud-account.md)
- [saveGameData(_:withName:completionHandler:)](gamekit/gklocalplayer/savegamedata(_:withname:completionhandler:).md)
- [fetchSavedGames(completionHandler:)](gamekit/gklocalplayer/fetchsavedgames(completionhandler:).md)
- [resolveConflictingSavedGames(_:with:completionHandler:)](gamekit/gklocalplayer/resolveconflictingsavedgames(_:with:completionhandler:).md)
- [deleteSavedGames(withName:completionHandler:)](gamekit/gklocalplayer/deletesavedgames(withname:completionhandler:).md)
- [GKSavedGame](gamekit/gksavedgame.md)
- [GKSavedGameListener](gamekit/gksavedgamelistener.md)

### Deprecated

- [Deprecated symbols](gamekit/gklocalplayer-deprecated-symbols.md)

## Relationships

### Inherits From

- [GKPlayer](gamekit/gkplayer.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [GKSavedGameListener](gamekit/gksavedgamelistener.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Players

- [Connecting players with their friends in your game](gamekit/connecting-players-with-their-friends-in-your-game.md)
- [Saving the player’s game data to an iCloud account](gamekit/saving-the-player-s-game-data-to-an-icloud-account.md)
- [Protecting the player’s privacy using scoped identifiers](gamekit/protecting-the-player-s-privacy-using-scoped-identifiers.md)
- [GKPlayer](gamekit/gkplayer.md)
- [GKBasePlayer](gamekit/gkbaseplayer.md)
- [GKLocalPlayerListener](gamekit/gklocalplayerlistener.md)
- [GKPlayerAuthenticationDidChangeNotificationName](foundation/nsnotification/name-swift.struct/gkplayerauthenticationdidchangenotificationname.md)
- [GKPlayerDidChangeNotificationName](foundation/nsnotification/name-swift.struct/gkplayerdidchangenotificationname.md)
