OrderedDictionary
public struct OrderedDictionary<Key, Value> : DictionaryProtocol where Key : Hashable
extension OrderedDictionary: Collection
extension OrderedDictionary: ExpressibleByDictionaryLiteral
extension OrderedDictionary: Equatable where Value: Equatable
extension OrderedDictionary: Hashable where Value: Hashable
Ordered Dictionary.
-
Ordered keys.
Declaration
Swift
public var keys: [Key] -
Values.
Declaration
Swift
public var unordered: [Key : Value]
-
Create an empty
OrderedDictionaryDeclaration
Swift
public init() -
Creates an empty
OrderedDictionarytype with preallocated space for at least the specified number of elements.Declaration
Swift
public init(minimumCapacity: Int)
-
Declaration
Swift
public subscript(key: Key) -> Value? { get set }Return Value
Value for the given
key, if available. Otherwise,nil.
-
Append
valuefor givenkey.Declaration
Swift
public mutating func append(_ value: Value, key: Key) -
Insert
valuefor givenkeyatindex.Declaration
Swift
public mutating func insert(_ value: Value, key: Key, index: Int) -
Append the contents of another
OrderedDictionarystructure.Declaration
Swift
public mutating func appendContents(of orderedDictionary: OrderedDictionary<Key, Value>) -
Reserves the amount of memory required to store the given
minimumCapacityof elements.Declaration
Swift
public mutating func reserveCapacity(_ minimumCapacity: Int) -
Declaration
Swift
public func value(index: Int) -> Value?Return Value
The value at the given
index.
-
- Index after given index
i.
Declaration
Swift
public func index(after i: Int) -> Int - Index after given index
-
Start index.
Declaration
Swift
public var startIndex: Int { get } -
End index.
Declaration
Swift
public var endIndex: Int { get } -
Declaration
Swift
public subscript(index: Int) -> (Key, Value) { get }Return Value
Element at the given
index.
-
Create an
OrderedDictionarywith aDictionaryLiteral.Declaration
Swift
public init(dictionaryLiteral elements: (Key, Value)...)
View on GitHub
Install in Dash
OrderedDictionary Structure Reference