mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
9ead8781d4
Co-authored-by: Alex Martini <amartini@apple.com> Co-authored-by: Graham Lee <glee23@apple.com> Co-authored-by: Chris Adamson <cadamson@apple.com> Co-authored-by: Kirby Turner <kirby_turner@apple.com> Co-authored-by: Paris Pinkney <ppinkney@apple.com> Co-authored-by: Dave Spector <dspector@apple.com> Co-authored-by: Sofia Rodriguez Morales <sofia_rodriguez@apple.com> Co-authored-by: Ethan Kusters <ekusters@apple.com> Co-authored-by: Goli Mohammadi <g_mohammadi@apple.com> Co-authored-by: Adora Vaz <a_vaz@apple.com> Co-authored-by: David Rönnqvist <ronnqvist@apple.com> Co-authored-by: Nate Merseth Cook <natecook@apple.com> Co-authored-by: Susan Conant <susan_c@apple.com>
3.2 KiB
3.2 KiB
Swift/Dictionary
Topics
Creating a Dictionary
In addition to using a dictionary literal, you can also create a dictionary using these initializers.
Swift/Dictionary/init()Swift/Dictionary/init(minimumCapacity:)Swift/Dictionary/init(uniqueKeysWithValues:)Swift/Dictionary/init(_:uniquingKeysWith:)Swift/Dictionary/init(grouping:by:)Swift/Dictionary/init(_:)
Inspecting a Dictionary
Swift/Dictionary/isEmpty-11b2wSwift/Dictionary/count-1s9fdSwift/Dictionary/capacity
Accessing Keys and Values
Swift/Dictionary/subscript(_:)-8rfqlSwift/Dictionary/subscript(_:default:)Swift/Dictionary/index(forKey:)Swift/Dictionary/subscript(_:)-4bhooSwift/Dictionary/keys-swift.propertySwift/Dictionary/values-swift.propertySwift/Dictionary/firstSwift/Dictionary/randomElement()Swift/Dictionary/randomElement(using:)Swift/Dictionary/init(dictionaryLiteral:)Swift/Dictionary/init(_:)Swift/Dictionary/indices
Adding Keys and Values
Swift/Dictionary/updateValue(_:forKey:)Swift/Dictionary/merge(_:uniquingKeysWith:)-m2ubSwift/Dictionary/merge(_:uniquingKeysWith:)-7smbbSwift/Dictionary/merging(_:uniquingKeysWith:)-3vtfsSwift/Dictionary/merging(_:uniquingKeysWith:)-9bik6Swift/Dictionary/reserveCapacity(_:)
Removing Keys and Values
Swift/Dictionary/filter(_:)Swift/Dictionary/removeValue(forKey:)Swift/Dictionary/remove(at:)Swift/Dictionary/removeAll(keepingCapacity:)
Comparing Dictionaries
Swift/Dictionary/==(_:_:)Swift/Dictionary/!=(_:_:)
Iterating over Keys and Values
Swift/Dictionary/forEach(_:)Swift/Dictionary/enumerated()Swift/Dictionary/lazySwift/Dictionary/makeIterator()Swift/Dictionary/underestimatedCount-4ggro
Finding Elements
Swift/Dictionary/contains(where:)Swift/Dictionary/allSatisfy(_:)Swift/Dictionary/first(where:)Swift/Dictionary/firstIndex(where:)Swift/Dictionary/min(by:)Swift/Dictionary/max(by:)Swift/Dictionary/indicesSwift/Dictionary/Element
Transforming a Dictionary
Swift/Dictionary/mapValues(_:)Swift/Dictionary/reduce(_:_:)Swift/Dictionary/reduce(into:_:)Swift/Dictionary/compactMap(_:)Swift/Dictionary/compactMapValues(_:)Swift/Dictionary/flatMap(_:)-i3lySwift/Dictionary/flatMap(_:)-6chv9Swift/Dictionary/sorted(by:)Swift/Dictionary/shuffled()Swift/Dictionary/shuffled(using:)
Performing Collection Operations
Encoding and Decoding
Swift/Dictionary/encode(to:)Swift/Dictionary/init(from:)-6e6js
Describing a Dictionary
Swift/Dictionary/descriptionSwift/Dictionary/debugDescriptionSwift/Dictionary/customMirrorSwift/Dictionary/hash(into:)
Supporting Types
Swift/Dictionary/Keys-swift.structSwift/Dictionary/Values-swift.structSwift/Dictionary/IndexSwift/Dictionary/IteratorSwift/Dictionary/Element
Infrequently Used Functionality
Swift/Dictionary/init(dictionaryLiteral:)