---
title: "isWin(for:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkgamemodel/iswin(for:)"
---

# isWin(for:)

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

## Declaration

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

## Parameters

- `player`: An instance of your game’s player class (a custom class implementing the doc://com.apple.gameplaykit/documentation/GameplayKit/GKGameModelPlayer protocol) representing the player evaluating the game model.

## Return Value

Return Value true if this game model represents a winning state for the specified player; false if the game has been won or has not yet concluded.

## Discussion

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 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:) 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 score(for:), isLoss(for:), and isWin(for:) methods.

## See Also

### Evaluating a Game Model

- [gameModelUpdates(for:)](gameplaykit/gkgamemodel/gamemodelupdates(for:).md)
- [score(for:)](gameplaykit/gkgamemodel/score(for:).md)
- [isLoss(for:)](gameplaykit/gkgamemodel/isloss(for:).md)
