CodingKey

protocol CodingKey

A type that can be used as a key for encoding and decoding.

Inheritance CustomDebugStringConvertible, CustomStringConvertible

Initializers

init init?(intValue:) Required

Creates a new instance from the specified integer.

If the value passed as intValue does not correspond to any instance of this type, the result is nil.

  • parameter intValue: The integer value of the desired key.

Declaration

init?(intValue: Int)
init init?(stringValue:) Required

Creates a new instance from the given string.

If the string passed as stringValue does not correspond to any instance of this type, the result is nil.

  • parameter stringValue: The string value of the desired key.

Declaration

init?(stringValue: String)

Instance Variables

var intValue Required

The value to use in an integer-indexed collection (e.g. an int-keyed dictionary).

Declaration

var intValue: Int?
var stringValue Required

The string to use in a named collection (e.g. a string-keyed dictionary).

Declaration

var stringValue: String