<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKGameModel/isWin(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKGameModel(im)isWinForPlayer:"
  },
  "title" : "isWin(for:)"
}
-->

# isWin(for:)

Returns a Boolean value indicating whether the current state of the game model reflects a win for the specified player.

```
optional func isWin(for player: any GKGameModelPlayer) -> Bool
```

## Parameters

`player`

An instance of your game’s player class (a custom class implementing the [`GKGameModelPlayer`](/documentation/GameplayKit/GKGameModelPlayer) protocol) representing the player evaluating the game model.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if this game model represents a winning state for the specified player; <doc://com.apple.documentation/documentation/Swift/false> if the game has been won or has not yet concluded.

## Discussion

If the game has been won or lost, a strategist evaluating the game model can avoid evaluating further moves in the game and can therefore plan a successful move more efficiently.

For some games, merely identifying winning and losing states of the game model and using a sufficiently large [`maxLookAheadDepth`](/documentation/GameplayKit/GKMinmaxStrategist/maxLookAheadDepth) value is enough for a strategist to play the game well. However, you can improve both the game performance and the runtime efficiency of move planning by also implementing the [`score(for:)`](/documentation/GameplayKit/GKGameModel/score(for:)) method to distinguish the relative desirability of non-game-ending states.

> Note:
> This method is optional; however, your game model class must implement at least one of the ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKGameModel/score(for:)``, ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKGameModel/isLoss(for:)``, and ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKGameModel/isWin(for:)`` methods.

---

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)