TKDeparturesProvider
@objc
public class TKDeparturesProvider : NSObject
Undocumented
-
Fetches departures from one or more stops, using the
departures.json
APIDeclaration
Parameters
stopCodes
Stop codes, which have to be in the same region
fromDate
Date of first departure to fetch
filters
Optional filters, that are treated as an “OR” condition.
limit
Maximum number of departures to fetch; not that API might return more than that if multiple departures are at the same time. Defaults to 10.
region
Region that the stops are in
Return Value
API response of departures from those stops
-
downloadDepartures(for:
AsynchronousfromDate: filters: limit: ) Undocumented
Declaration
Swift
public static func downloadDepartures(for stops: [StopLocation], fromDate: Date, filters: [Filter] = [], limit: Int = 10) async throws -> Bool
-
fetchDepartures(for:
AsynchronousfromDate: limit: ) Undocumented
Declaration
Swift
public static func fetchDepartures(for table: TKDLSTable, fromDate: Date = Date(), limit: Int = 10) async throws -> TKAPI.Departures
-
downloadDepartures(for:
AsynchronousfromDate: limit: ) Undocumented
Declaration
Swift
public static func downloadDepartures(for table: TKDLSTable, fromDate: Date, limit: Int = 10) async throws -> Set<String>
-
Undocumented
Declaration
Swift
public static func queryParameters(for table: TKDLSTable, fromDate: Date, limit: Int) -> [String : Any]
-
Undocumented
Declaration
Swift
public static func addDepartures(_ departures: TKAPI.Departures, to stops: [StopLocation]) -> Bool
-
Undocumented
Declaration
Swift
public static func addDepartures(_ departures: TKAPI.Departures, into context: NSManagedObjectContext) -> Set<String>