Instance Method

shuffledArray

Returns a new array that lists this array’s elements in a random order.

Declaration

- (NSArray<ObjectType> *)shuffledArray;

Return Value

A new array that lists this array’s elements in a random order.

Discussion

Calling this method is equivalent to calling the shuffledArrayWithRandomSource: method and passing the system sharedRandom random source. To influence the random shuffling or to be able to deterministically reproduce a series of shuffles, create your own GKRandomSource object.

See Also

Randomly Shuffling an Array

- shuffledArrayWithRandomSource:

Returns a new array that lists this array’s elements in a random order, using the specified random source.