DataSource
open class DataSource<Type> where Type : Decodable
Generic Data Source for parsing NYMTA data
-
All values
Declaration
Swift
public var values: [Type] { get } -
Initialize from JSON data
Throws
When unable to decode the JSON dataDeclaration
Swift
public required init(json: Data) throwsParameters
jsonJSON data
-
Initialized from a JSON asset in the specified Bundle
Throws
When unable to find the data asset or unable to decode the JSON dataDeclaration
Swift
public convenience init(jsonDataAssetName assetName: String, bundle: Bundle) throwsParameters
assetNameJSON asset name
bundleBundle
-
Initialize from CSV string
Throws
When unable to decode the CSV dataDeclaration
Swift
public required init(csv: String) throwsParameters
csvCSV string
-
Initialize from CSV data
Throws
When unable to decode the CSV dataDeclaration
Swift
public convenience init(csv: Data) throwsParameters
csvCSV data
-
Initialize from a CSV asset in the specified Bundle
Throws
When unable to find the data asset or unable to decode the CSV dataDeclaration
Swift
public convenience init(csvDataAssetName assetName: String, bundle: Bundle) throwsParameters
assetNameCSV asset name
bundleBundle
View on GitHub
DataSource Class Reference