Returns a shared instance that shares a system-wide random source.
- iOS 9.0+
- macOS 10.11+
- tvOS 9.0+
The shared system random source.
The system random source shares state with the arc4random family of C functions. Generating random numbers with this source modifies the outcome of future calls to those functions, and calling those functions modifies the sequence of random values generated by this source. As such, this source is neither deterministic nor independent—use it only for trivial gameplay mechanics that do not rely on those attributes.
To instead use an independent random source, create an instance of one of the
GKRandom subclasses. The
GKARC4Random class employs a similar algorithm but is independent from the system random source.