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

# selectChallengeablePlayers(_:withCompletionHandler:)

Finds the subset of players who can earn an achievement.

```
func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (@Sendable ([GKPlayer]?, (any Error)?) -> Void)? = nil)
```

## Parameters

`players`

A list of players that GameKit uses to find players who are eligible to earn the achievement.

`completionHandler`

A block that GameKit calls when this method completes.

    The block receives the following parameters:

- `challengeablePlayers`: The players in the `players` parameter who are able to earn the achievement.
- `error`: Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

---

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)