Structure
SomeCodingKey
A straightforward implementation of
CodingKey, used to represent arbitrary keys.struct SomeCodingKey
Overview
This type is a simple helper, compensating for the inability to depend on the presence of CodingKeyRepresentable (introduced in Swift 5.6 and tagged with a macOS 12.3/iOS 15.4 availability requirement) without a major version bump.
Note
Both the purpose and implementation of this type are almost exactly identical to those of the standard library’s internal _DictionaryCodingKey type.
Topics
Initializers
init(intValue: Int)Creates a new instance from the specified integer.init(stringValue: String)Creates a new instance from the given string.
Instance Properties
let intValue: Int?The value to use in an integer-indexed collection (e.g. an int-keyed dictionary).let stringValue: StringThe string to use in a named collection (e.g. a string-keyed dictionary).
Relationships
Conforms To
Swift.CodingKeySwift.CustomDebugStringConvertibleSwift.CustomStringConvertibleSwift.EquatableSwift.HashableSwift.SendableSwift.SendableMetatype