<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKAchievement/init(identifier:player:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKAchievement(im)initWithIdentifier:player:"
  },
  "title" : "init(identifier:player:)"
}
-->

# init(identifier:player:)

Initializes an achievement for a player.

```
init(identifier: String, player: GKPlayer)
```

## Parameters

`identifier`

The identifier for the achievement that you enter in App Store Connect.

`player`

The player who is earning the achievement.

## Return Value

An achievement for a player, or `nil` if an error occurs.

## Discussion

Before creating an achievement, use the [`loadAchievements(completionHandler:)`](/documentation/GameKit/GKAchievement/loadAchievements(completionHandler:)) method to load the achievements that are in progress. If the achievement you want to report progress on isn’t in the array that GameKit passes to the handler, use this method to initialize the achievement, but only when reporting progress for a participant at the end of a turn-based match. Otherwise, use the [`init(identifier:)`](/documentation/GameKit/GKAchievement/init(identifier:)) method to initialize the achievement.

---

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)