PlistCoder

open class PlistCoder : CoderProtocol

Encapsulates the PropertyListEncoder and PropertyListDecoder classes

  • Property list encoder

    Declaration

    Swift

    public let encoder: PropertyListEncoder
  • Property list decoder

    Declaration

    Swift

    public let decoder: PropertyListDecoder
  • Empty public initializer

    Declaration

    Swift

    public init()
  • Generic decoding function which decodes Data to the given Codable type

    Throws

    <#throws value description#>

    Declaration

    Swift

    open func decode<T>(_ type: T.Type, from data: Data) throws -> T where T : Decodable

    Parameters

    type

    requested Codable type format. example String.

    data

    a Data object to decode

    Return Value

    the decoded object as requested Codable type

  • Generic encoding function which encodes the given Codable type to Data

    Throws

    <#throws value description#>

    Declaration

    Swift

    open func encode<Value>(_ value: Value) throws -> Data where Value : Encodable

    Parameters

    value

    Codable value which has to be encoded

    Return Value

    encoded Data