Returns an iterator over the dictionary’s key-value pairs.
SDK
- Xcode 10.2+
Framework
- Swift Standard Library
Declaration
Return Value
An iterator over the dictionary with elements of type (key: Key, value: Value)
.
Discussion
Iterating over a dictionary yields the key-value pairs as two-element tuples. You can decompose the tuple in a for
-in
loop, which calls make
behind the scenes, or when calling the iterator’s next()
method directly.