---
title: "init(identifier:player:)"
framework: gamekit
role: symbol
role_heading: Initializer
path: "gamekit/gkachievement/init(identifier:player:)"
---

# init(identifier:player:)

Initializes an achievement for a player.

## Declaration

```swift
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.

## Mentioned in

Rewarding players with achievements

## Return Value

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

## Discussion

Discussion Before creating an achievement, use the 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:) method to initialize the achievement.

## See Also

### Loading and Initializing Achievements

- [loadAchievements(completionHandler:)](gamekit/gkachievement/loadachievements(completionhandler:).md)
- [init(identifier:)](gamekit/gkachievement/init(identifier:).md)
