FieldCoderType
public protocol FieldCoderType
Types that implement encoding to and decoding from Data to be used in Field.Coded properties’ coder: argument.
class Person: CoreStoreObject {
@Field.Coded("profile", coder: FieldCoders.Json.self)
var profile: Profile = .init()
}
-
The type to encode to and decode from
DataDeclaration
Swift
associatedtype FieldStoredValue -
Encodes the value to
DataDeclaration
Swift
static func encodeToStoredData(_ fieldValue: FieldStoredValue?) -> Data? -
Decodes the value from
DataDeclaration
Swift
static func decodeFromStoredData(_ data: Data?) -> FieldStoredValue?
View on GitHub
FieldCoderType Protocol Reference