---
title: maxPlayers
framework: gamekit
role: symbol
role_heading: Instance Property
path: gamekit/gkmatchrequest/maxplayers
---

# maxPlayers

The maximum number of players that can join the match.

## Declaration

```swift
var maxPlayers: Int { get set }
```

## Mentioned in

Finding multiple players for a game Finding players using matchmaking rules Starting turn-based matches and passing turns between players

## Discussion

Discussion The possible values range from the minimum number of players to the value returned by the maxPlayersAllowedForMatch(of:) method. To set the minimum number of players, use the minPlayers property. If you use matchmaking rules, the rule set’s maxPlayers field constrains this value. Set this property to a value in the range of the rule set’s minPlayers and maxPlayers fields. The default value is the rule set’s maxPlayers field.

## See Also

### Related Documentation

- [Create a Rule Set](appstoreconnectapi/post-v1-gamecentermatchmakingrulesets.md)

### Restricting the number of players

- [maxPlayersAllowedForMatch(of:)](gamekit/gkmatchrequest/maxplayersallowedformatch(of:).md)
- [GKMatchType](gamekit/gkmatchtype.md)
- [minPlayers](gamekit/gkmatchrequest/minplayers.md)
- [defaultNumberOfPlayers](gamekit/gkmatchrequest/defaultnumberofplayers.md)
