nextInt(upperBound:)
Generates and returns a new random integer within the bounds of the distribution and less than the specified limit.
Declaration
func nextInt(upperBound: Int) -> IntParameters
- upperBound:
A limit on the values of random numbers to generate.
Return Value
A new random integer less than the value of the upperBound parameter.
Discussion
Randomly generated integers are in the range specified by the distribution’s lowestValue and highestValue properties (inclusive). The actual upper bound on numbers generated by this method is the lesser of the highestValue property and the upperBound parameter.
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.