Instance Method

reversed()

Returns an array containing the elements of this sequence in reverse order.

Declaration

func reversed() -> [Entity]

Return Value

An array containing the elements of this sequence in reverse order.

Discussion

The sequence must be finite.

Complexity: O(n), where n is the length of the sequence.

See Also

Reordering Entities

func sorted(by: (Entity, Entity) -> Bool) -> [Entity]

Returns the elements of the sequence, sorted using the given predicate as the comparison between elements.

func shuffled() -> [Entity]

Returns the elements of the sequence, shuffled.

func shuffled<T>(using: inout T) -> [Entity]

Returns the elements of the sequence, shuffled using the given generator as a source for randomness.