TKWaypointRouter
public enum TKWaypointRouter
Provides helper methods around TripGo API’s waypoint.json
endpoint
For planning A-to-B-via-C trips, including building trip that follow a specific segment pattern.
-
Undocumented
See moreDeclaration
Swift
public enum WaypointError : Error
-
Calculates a trip based on the provided trip. Departure time is the provided time or now, whichever is later.
Declaration
Swift
public static func fetchNextTrip(after trip: Trip, usingPrivateVehicles vehicles: [TKVehicular] = [], completion: @escaping (Result<Trip, Error>) -> Void)
Parameters
trip
The trip for which to get the next departure
vehicles
Optional vehicles that should be for private vehicles segments
completion
Handler called on success with a trip or on error (with optional
Error
) -
Calculates a trip from the provided pattern. Departure time is the provided time or now, whichever is later.
Declaration
Swift
public static func fetchTrip(pattern: [TKSegmentPattern], departure: Date, usingPrivateVehicles vehicles: [TKVehicular] = [], into tripKitContext: NSManagedObjectContext = TripKit.shared.viewContext, in region: TKRegion, completion: @escaping (Result<Trip, Error>) -> Void)
Parameters
pattern
The pattern that’s used as input to calculate a trip
departure
Departure time for new trip (ignored if before current time)
vehicles
Optional vehicles that should be for private vehicles segments
tripKit
TripKit instance into which the new trip will be inserted
region
The region where the trip starts
completion
Handler called on success with a trip or on error (with optional
Error
)
-
Calculates a trip from the provided trip (implied by the segment), which moves where to get on or off the provided
segment
to the providedvisit
.Declaration
Swift
public static func fetchTrip(moving segment: TKSegment, to visit: StopVisits, atStart: Bool, usingPrivateVehicles vehicles: [TKVehicular] = [], completion: @escaping (Result<Trip, Error>) -> Void)
Parameters
segment
The segment for which to change getting on/off
visit
The visit along this segment to get on/off
atStart
true
if getting on should change,false
if getting off should changevehicles
The private vehicles to use for private vehicle segments
completion
Handler called on success with a trip or on error (with optional
Error
) -
Undocumented
Declaration
Swift
public static func fetchTrip(replacing segment: TKSegment, with entry: DLSEntry, usingPrivateVehicles vehicles: [TKVehicular] = [], completion: @escaping (Result<Trip, Error>) -> Void)
-
Undocumented
Declaration
Swift
public static func fetchTrip(byMoving segment: TKSegment, to location: TKModeCoordinate, usingPrivateVehicles vehicles: [TKVehicular] = [], completion: @escaping (Result<Trip, Error>) -> Void)
-
Undocumented
Declaration
Swift
public static func fetchTrip(addingStopOver stopOver: CLLocationCoordinate2D, to trip: Trip, usingPrivateVehicles vehicles: [TKVehicular] = [], completion: @escaping (Result<Trip, Error>) -> Void)
-
fetchTrip(addingStopOver:
Asynchronousto: usingPrivateVehicles: ) Undocumented
Declaration
Swift
public static func fetchTrip(addingStopOver stopOver: CLLocationCoordinate2D, to trip: Trip, usingPrivateVehicles vehicles: [TKVehicular] = []) async throws -> Trip
-
Undocumented
Declaration
Swift
public struct Input : Codable
-
Undocumented
See moreDeclaration