Instance Method

reversed()

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

Declaration

func reversed() -> [(key: Key, value: Value)]

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

Transforming a Dictionary's Elements

func split(maxSplits: Int, omittingEmptySubsequences: Bool, whereSeparator: ((key: Key, value: Value)) -> Bool) -> [Slice<Dictionary<Key, Value>>]

Returns the longest possible subsequences of the collection, in order, that don’t contain elements satisfying the given predicate.

func withContiguousStorageIfAvailable<R>((UnsafeBufferPointer<(key: Key, value: Value)>) -> R) -> R?

Call body(p), where p is a pointer to the collection’s contiguous storage. If no such storage exists, it is first created. If the collection does not support an internal representation in a form of contiguous storage, body is not called and nil is returned.