Instance Property

underestimatedCount

A value less than or equal to the number of elements in the collection.

Declaration

var underestimatedCount: Int { get }

Discussion

Complexity: O(1) if the collection conforms to RandomAccessCollection; otherwise, O(n), where n is the length of the collection.

See Also

Iterating over Keys and Values

func forEach(((key: Key, value: Value)) -> Void)

Calls the given closure on each element in the sequence in the same order as a for-in loop.

func enumerated() -> EnumeratedSequence<Dictionary<Key, Value>>

Returns a sequence of pairs (n, x), where n represents a consecutive integer starting at zero and x represents an element of the sequence.

var lazy: LazySequence<Dictionary<Key, Value>>

A sequence containing the same elements as this sequence, but on which some operations, such as map and filter, are implemented lazily.

func makeIterator() -> Dictionary<Key, Value>.Iterator

Returns an iterator over the dictionary’s key-value pairs.