Instance Method

nextBool()

Generates and returns a new random Boolean value.

Required.

Declaration

func nextBool() -> Bool

Return Value

A random Boolean value.

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

func nextInt() -> Int

Generates and returns a new random integer.

Required.

func nextInt(upperBound: Int) -> Int

Generates and returns a new random integer less than the specified limit.

Required.

func nextUniform() -> Float

Generates and returns a new random floating-point value.

Required.