CSVSyncDecoder
public final class CSVSyncDecoder
A decoder for decoding a single CSV document all at once.
You can get an instance of CSVSyncDecoder
from the CSVDecoder.sync
property.
-
Decodes a whole CSV document into an array of a specified
Decodable
type.Throws
Errors that occur during the decoding proccess.
Declaration
Swift
public func decode<D>(_ type: D.Type = D.self, from data: Data)throws -> [D] where D: Decodable
Parameters
type
The
Decodable
type to decode the CSV rows to.data
The CSV data to decode.
Return Value
An array of
D
instances, decoded from the data passed in.