DictionaryIndex

struct DictionaryIndex<Key : Hashable, Value>

Used to access the key-value pairs in an instance of Dictionary<Key, Value>.

Dictionary has two subscripting interfaces:

  1. Subscripting with a key, yielding an optional value:

    v = d[k]!

  2. Subscripting with an index, yielding a key-value pair:

    (k, v) = d[i]

Inheritance Comparable, Equatable View Protocol Hierarchy →
Import import Swift

Instance Methods

func <(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

This function is the only requirement of the Comparable protocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms to Comparable.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func <(lhs: DictionaryIndex<Key, Value>, rhs: DictionaryIndex<Key, Value>) -> Bool
func ==(_:rhs:)

Returns a Boolean value indicating whether two values are equal.

Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func ==(lhs: DictionaryIndex<Key, Value>, rhs: DictionaryIndex<Key, Value>) -> Bool