---
title: "selectChallengeablePlayerIDs(_:withCompletionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkachievement/selectchallengeableplayerids(_:withcompletionhandler:)"
---

# selectChallengeablePlayerIDs(_:withCompletionHandler:)

Finds the subset of players who can earn an achievement.

## Declaration

```swift
func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (@Sendable ([String]?, (any Error)?) -> Void)? = nil)
```

```swift
func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String]
```

## Parameters

- `playerIDs`: An array of NSString objects containing a list of players. The list of players is used to find those players that are eligible to earn the achievement.
- `completionHandler`: A block to be called when the download is completed. The block receives the following parameters:

## Discussion

Discussion When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

## See Also

### Deprecated Methods

- [issueChallenge(toPlayers:message:)](gamekit/gkachievement/issuechallenge(toplayers:message:).md)
- [report(completionHandler:)](gamekit/gkachievement/report(completionhandler:).md)
