---
title: "isValidPartyCode(_:)"
framework: gamekit
role: symbol
role_heading: Type Method
path: "gamekit/gkgameactivity/isvalidpartycode(_:)"
---

# isValidPartyCode(_:)

Checks whether a party code is in valid format.

## Declaration

```swift
class func isValidPartyCode(_ partyCode: String) -> Bool
```

## Mentioned in

Creating activities for your game

## Discussion

Discussion Party code should be two parts of strings with the same length (2-6) connected with a dash, and the code can be either pure digits (0-9), or both parts are uppercased characters from validPartyCodeAlphabet.

## See Also

### Getting and verifying the party code

- [partyCode](gamekit/gkgameactivity/partycode.md)
- [partyURL](gamekit/gkgameactivity/partyurl.md)
- [validPartyCodeAlphabet](gamekit/gkgameactivity/validpartycodealphabet.md)
