<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKPlayer/loadPhoto(for:withCompletionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKPlayer(im)loadPhotoForSize:withCompletionHandler:"
  },
  "title" : "loadPhoto(for:withCompletionHandler:)"
}
-->

# loadPhoto(for:withCompletionHandler:)

Loads a photo of the player from Game Center.

```
func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: (@Sendable (UIImage?, (any Error)?) -> Void)? = nil)
```

## Parameters

`size`

A constant that determines the size of the photo to load.

`completionHandler`

The block that GameKit calls when it completes the request.

    The block receives the following parameters:

- *photo*: An image of the player. If an error occurs, this may be a cached image already on the device; otherwise, it is `nil`.
- *error*: Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

The size of the image that returns to your game is dependent on both the size parameter and the user interface idiom of the device your game is running on.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)