NSDictionary
class NSDictionaryclass NSDictionaryimport Foundationclass NSObjectThe root class of most Foundation class hierarchies.
protocol CopyableA type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol CustomReflectableA type that explicitly supplies its own mirror.
protocol CustomStringConvertibleA type with a customized textual representation.
protocol EquatableA type that can be compared for value equality.
protocol Escapableprotocol ExpressibleByDictionaryLiteralA type that can be initialized using a dictionary literal.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol NSCodingThe NSCoding protocol declares the two methods that a class must implement so that instances of that class can be encoded and decoded. This capability provides the basis for archiving (where objects and other structures are stored on disk) and distribution (where objects are copied to different address spaces).
protocol NSCopyingThe NSCopying protocol declares a method for providing functional copies of an object. The exact meaning of “copy” can vary from class to class, but a copy must be a functionally independent object with values identical to the original at the time the copy was made.
protocol NSMutableCopyingThe NSMutableCopying protocol declares a method for providing mutable copies of an object. Only classes that define an “immutable vs. mutable” distinction should adopt this protocol. Classes that don’t define such a distinction should adopt NSCopying instead.
protocol NSObjectProtocol : AnyObjectThe NSObjectProtocol groups methods that are fundamental to all Foundation objects.
protocol NSSecureCoding : NSCodingConforming to the NSSecureCoding protocol indicates that an object handles encoding and decoding instances of itself in a manner that is robust against object substitution attacks.
protocol Sequence<Element>A type that provides sequential, iterated access to its elements.
override convenience init() required convenience init?(coder aDecoder: NSCoder) convenience init(dictionary otherDictionary: [AnyHashable : Any]) convenience init(dictionary otherDictionary: [AnyHashable : Any], copyItems flag: Bool) required convenience init(dictionaryLiteral elements: (Any, Any)...) convenience init(object: Any, forKey key: any NSCopying) convenience init(objects: [Any], forKeys keys: [NSObject]) required init(objects: UnsafePointer<AnyObject>!, forKeys keys: UnsafePointer<NSObject>!, count cnt: Int) static var supportsSecureCoding: Bool { get }class func sharedKeySet(forKeys keys: [any NSCopying]) -> Any var allKeys: [Any] { get }var allValues: [Any] { get }var count: Int { get }var customMirror: Mirror { get }override var description: String { get }A string that represents the contents of the dictionary, formatted as a property list (read-only)
var descriptionInStringsFileFormat: String { get }override var hash: Int { get }subscript(key: Any) -> Any? { get } func allKeys(for anObject: Any) -> [Any] override func copy() -> Any func copy(with zone: NSZone? = nil) -> Any func description(withLocale locale: Locale?) -> String Returns a string object that represents the contents of the dictionary, formatted as a property list.
func description(withLocale locale: Locale?, indent level: Int) -> String Returns a string object that represents the contents of the dictionary, formatted as a property list.
func encode(with aCoder: NSCoder) func enumerateKeysAndObjects(_ block: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Void) func enumerateKeysAndObjects(options opts: NSEnumerationOptions = [], using block: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Void) func getObjects(_ objects: inout [Any], andKeys keys: inout [Any], count: Int) Alternative pseudo funnel method for fastpath fetches from dictionaries
override func isEqual(_ value: Any?) -> Bool func isEqual(to otherDictionary: [AnyHashable : Any]) -> Bool func keyEnumerator() -> NSEnumerator func keysOfEntries(options opts: NSEnumerationOptions = [], passingTest predicate: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Set<AnyHashable> func keysOfEntries(passingTest predicate: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Set<AnyHashable> func keysSortedByValue(comparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] func keysSortedByValue(options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] func makeIterator() -> NSDictionary.Iterator override func mutableCopy() -> Any func mutableCopy(with zone: NSZone? = nil) -> Any func object(forKey aKey: Any) -> Any? func objectEnumerator() -> NSEnumerator func objects(forKeys keys: [Any], notFoundMarker marker: Any) -> [Any] func value(forKey key: String) -> Any? func write(to url: URL, atomically: Bool) -> Bool func write(toFile path: String, atomically useAuxiliaryFile: Bool) -> Bool struct Iteratorconvenience init?(contentsOf url: URL) convenience init?(contentsOfFile path: String) var lazy: LazySequence<Self> { get }A sequence containing the same elements as this sequence, but on which some operations, such as map and filter, are implemented lazily.
var underestimatedCount: Int { get }A value less than or equal to the number of elements in the sequence, calculated nondestructively.
func allSatisfy(_ predicate: (Self.Element) throws -> Bool) rethrows -> Bool Returns a Boolean value indicating whether every element of a sequence satisfies a given predicate.
func compactMap<ElementOfResult>(_ transform: (Self.Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] Returns an array containing the non-nil results of calling the given transformation with each element of this sequence.
func contains(where predicate: (Self.Element) throws -> Bool) rethrows -> Bool Returns a Boolean value indicating whether the sequence contains an element that satisfies the given predicate.
func count<E>(where predicate: (Self.Element) throws(E) -> Bool) throws(E) -> Int where E : Error Returns the number of elements in the sequence that satisfy the given predicate.
func drop(while predicate: (Self.Element) throws -> Bool) rethrows -> DropWhileSequence<Self> Returns a sequence by skipping the initial, consecutive elements that satisfy the given predicate.
func dropFirst(_ k: Int = 1) -> DropFirstSequence<Self> Returns a sequence containing all but the given number of initial elements.
func dropLast(_ k: Int = 1) -> [Self.Element] Returns a sequence containing all but the given number of final elements.
func elementsEqual<OtherSequence>(_ other: OtherSequence, by areEquivalent: (Self.Element, OtherSequence.Element) throws -> Bool) rethrows -> Bool where OtherSequence : Sequence Returns a Boolean value indicating whether this sequence and another sequence contain equivalent elements in the same order, using the given predicate as the equivalence test.
func enumerated() -> EnumeratedSequence<Self> Returns a sequence of pairs (n, x), where n represents a consecutive integer starting at zero and x represents an element of the sequence.
func filter(_ isIncluded: (Self.Element) throws -> Bool) rethrows -> [Self.Element] Returns an array containing, in order, the elements of the sequence that satisfy the given predicate.
func first(where predicate: (Self.Element) throws -> Bool) rethrows -> Self.Element? Returns the first element of the sequence that satisfies the given predicate.
func flatMap<SegmentOfResult>(_ transform: (Self.Element) throws -> SegmentOfResult) rethrows -> [SegmentOfResult.Element] where SegmentOfResult : Sequence Returns an array containing the concatenated results of calling the given transformation with each element of this sequence.
func forEach(_ body: (Self.Element) throws -> Void) rethrows Calls the given closure on each element in the sequence in the same order as a for-in loop.
func lexicographicallyPrecedes<OtherSequence>(_ other: OtherSequence, by areInIncreasingOrder: (Self.Element, Self.Element) throws -> Bool) rethrows -> Bool where OtherSequence : Sequence, Self.Element == OtherSequence.Element Returns a Boolean value indicating whether the sequence precedes another sequence in a lexicographical (dictionary) ordering, using the given predicate to compare elements.
func map<T, E>(_ transform: (Self.Element) throws(E) -> T) throws(E) -> [T] where E : Error Returns an array containing the results of mapping the given closure over the sequence’s elements.
@warn_unqualified_access func max(by areInIncreasingOrder: (Self.Element, Self.Element) throws -> Bool) rethrows -> Self.Element? Returns the maximum element in the sequence, using the given predicate as the comparison between elements.
@warn_unqualified_access func min(by areInIncreasingOrder: (Self.Element, Self.Element) throws -> Bool) rethrows -> Self.Element? Returns the minimum element in the sequence, using the given predicate as the comparison between elements.
func prefix(_ maxLength: Int) -> PrefixSequence<Self> Returns a sequence, up to the specified maximum length, containing the initial elements of the sequence.
func prefix(while predicate: (Self.Element) throws -> Bool) rethrows -> [Self.Element] Returns a sequence containing the initial, consecutive elements that satisfy the given predicate.
func reduce<Result>(_ initialResult: Result, _ nextPartialResult: (Result, Self.Element) throws -> Result) rethrows -> Result Returns the result of combining the elements of the sequence using the given closure.
func reduce<Result>(into initialResult: Result, _ updateAccumulatingResult: (inout Result, Self.Element) throws -> ()) rethrows -> Result Returns the result of combining the elements of the sequence using the given closure.
func reversed() -> [Self.Element] Returns an array containing the elements of this sequence in reverse order.
func shuffled() -> [Self.Element] Returns the elements of the sequence, shuffled.
func shuffled<T>(using generator: inout T) -> [Self.Element] where T : RandomNumberGenerator Returns the elements of the sequence, shuffled using the given generator as a source for randomness.
func sorted(by areInIncreasingOrder: (Self.Element, Self.Element) throws -> Bool) rethrows -> [Self.Element] Returns the elements of the sequence, sorted using the given predicate as the comparison between elements.
func split(maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true, whereSeparator isSeparator: (Self.Element) throws -> Bool) rethrows -> [ArraySlice<Self.Element>] Returns the longest possible subsequences of the sequence, in order, that don’t contain elements satisfying the given predicate. Elements that are used to split the sequence are not returned as part of any subsequence.
func starts<PossiblePrefix>(with possiblePrefix: PossiblePrefix, by areEquivalent: (Self.Element, PossiblePrefix.Element) throws -> Bool) rethrows -> Bool where PossiblePrefix : Sequence Returns a Boolean value indicating whether the initial elements of the sequence are equivalent to the elements in another sequence, using the given predicate as the equivalence test.
func suffix(_ maxLength: Int) -> [Self.Element] Returns a subsequence, up to the given maximum length, containing the final elements of the sequence.
func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Self.Element>) throws -> R) rethrows -> R? func flatMap<ElementOfResult>(_ transform: (Self.Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] class NSMutableDictionary