init(coder:)
required convenience init?(coder aDecoder: NSCoder)
required convenience init?(coder aDecoder: NSCoder)
import Foundation
class NSDictionary
class NSCoder
The NSCoder
abstract class declares the interface used by concrete subclasses to transfer objects and other values between memory and some other format. This capability provides the basis for archiving (where objects and data items are stored on disk) and distribution (where objects and data items are copied between different processes or threads). The concrete subclasses provided by Foundation for these purposes are NSKeyedArchiver
and NSKeyedUnarchiver
. Concrete subclasses of NSCoder
are referred to in general as coder classes, and instances of these classes as coder objects (or simply coders). A coder object that can only encode values is referred to as an encoder object, and one that can only decode values as a decoder object.
override convenience init()
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 Iterator
convenience init?(contentsOf url: URL)
convenience init?(contentsOfFile path: String)