<!--
{
  "availability" : [
    "iOS: 6.0.0 - 8.0.0",
    "iPadOS: 6.0.0 - 8.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.8.0 - 10.10.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKAchievement/selectChallengeablePlayerIDs(_:withCompletionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKAchievement(im)selectChallengeablePlayerIDs:withCompletionHandler:"
  },
  "title" : "selectChallengeablePlayerIDs(_:withCompletionHandler:)"
}
-->

# selectChallengeablePlayerIDs(_:withCompletionHandler:)

Finds the subset of players who can earn an achievement.

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

## 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:

- *challengeablePlayerIDs*: An array of player identifiers representing the players in the original array that are able to complete the challenge. If an error occurred, this parameter may be non-`nil`, in which case the array holds whatever achievement information Game Kit was able to fetch.
- *error*: If an error occurred, this object describes the error. If the operation completed successfully, this value is `nil`.

## 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.

---

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)