---
title: nextBool()
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: gameplaykit/gkrandom/nextbool()
---

# nextBool()

Generates and returns a new random Boolean value.

## Declaration

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

## Return Value

Return Value A random Boolean value.

## Discussion

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

## See Also

### Generating Random Numbers

- [nextInt()](gameplaykit/gkrandom/nextint().md)
- [nextInt(upperBound:)](gameplaykit/gkrandom/nextint(upperbound:).md)
- [nextUniform()](gameplaykit/gkrandom/nextuniform().md)
