OrderedDictionary

public struct OrderedDictionary<K, V> where K : Hashable
extension OrderedDictionary: Sequence, IteratorProtocol
  • OrderedDictionary constructor.

    Declaration

    Swift

    public init()
  • Read only property that provides the number of elements in the OrderedDictionary.

    Declaration

    Swift

    public var count: Int { get }
  • Provides a way to add and remove elements from the OrderedDictionary, just like any other Dictionary.

    Setting an element to nil will remove it from the OrderedDictionary.

    Declaration

    Swift

    public subscript(key: K) -> V? { get set }
  • Return the element value at the numeric index specified.

    Declaration

    Swift

    public subscript(index: Int) -> V? { get }
  • Read only property that provides a String containing the key:value pairs in the OrderedDictionary.

    Declaration

    Swift

    public var description: String { get }
  • Method to allow iteration over the contents of the OrderedDictionary. This method ensures that items are read in the same sequence as they were added.

    Declaration

    Swift

    public mutating func next() -> (K, V)?