<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKGameActivity/isValidPartyCode(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKGameActivity(cm)isValidPartyCode:"
  },
  "title" : "isValidPartyCode(_:)"
}
-->

# isValidPartyCode(_:)

Checks whether a party code is in valid format.

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

## 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`](/documentation/GameKit/GKGameActivity/validPartyCodeAlphabet).

---

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)