Initializer

init()

Initializes a random source from a nondeterministic seed.

Declaration

convenience init()

Return Value

A new, independent random source.

Discussion

Calling this method seeds the random source with a sequence of bytes sampled from a high-entropy system source. To later replicate the sequence of numbers generated by this source, read the seed property and use the resulting value to initialize another random source with the init(seed:) initializer.

See Also

Creating a Random Source

init(seed: UInt64)

Initializes a random source with the specified seed value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software