---
title: nextInt()
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: gameplaykit/gkrandomdistribution/nextint()
---

# nextInt()

Generates and returns a new random integer within the bounds of the distribution.

## Declaration

```swift
func nextInt() -> Int
```

## Return Value

Return Value An integer in the range specified by the distribution’s lowestValue and highestValue properties (inclusive).

## Discussion

Discussion When using the GKRandomDistribution directly, generated numbers are uniform within this range. Subclasses of GKRandomDistribution can alter the relative probability of generating any particular number within the distribution’s range.

## See Also

### Generating Random Numbers

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