<!--
{
  "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/GKRandom/nextBool()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKRandom(im)nextBool"
  },
  "title" : "nextBool()"
}
-->

# nextBool()

Generates and returns a new random Boolean value.

```
func nextBool() -> Bool
```

## Return Value

A random Boolean value.

## Discussion

Typically, custom classes implementing this protocol should implement the [`nextBool()`](/documentation/GameplayKit/GKRandom/nextBool()) method based on the value returned by the [`nextInt(upperBound:)`](/documentation/GameplayKit/GKRandom/nextInt(upperBound:)) method. Alternative implementations are possible, but may lead to less uniform results.

---

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)