Trip Planning

TripKit’s trip planning capabilities provide wrappers around SkedGo’s routing APIs, parsing and caching the results, and encapsulating the logic for dealing with regions and available modes.

Refer to the following classes:

  • A TKRouter calculates trips for routing requests, it talks to SkedGo’s routing.json API.

    See more

    Declaration

    Objective-C

    @interface TKRouter : NSObject

    Swift

    class TKRouter : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface TKBuzzRealTime : NSObject
    
    - (void)updateTrip:(Trip *)trip
               success:(void (^)(Trip *trip, BOOL tripUpdated))success
               failure:(void (^)(NSError * _Nullable error))failure;
    
    + (void)updateDLSEntries:(NSSet<DLSEntry *> *)entries
                    inRegion:(TKRegion *)region
                     success:(void (^)(NSSet<DLSEntry *> *entries))success
                     failure:(void (^)(NSError * _Nullable error))failure;
    
    + (void)updateEmbarkations:(NSSet<StopVisits *> *)embarkations
                      inRegion:(TKRegion *)region
                       success:(void (^)(NSSet<StopVisits *> *embarkations))success
                       failure:(void (^)(NSError * _Nullable error))failure;
    
    + (void)updateServices:(NSSet<Service *> *)services
                  inRegion:(TKRegion *)region
                   success:(void (^)(NSSet<Service *> *services))success
                   failure:(void (^)(NSError * _Nullable error))failure;
    
    @end

    Swift

    class TKBuzzRealTime : NSObject
  • Fetches trips for a request

    Also takes care of localising the user, if the query involves the user’s current location, and handles being hit multiple times with different requests by only returning results from the last requested query.

    See more

    Declaration

    Swift

    public class TKResultsFetcher
  • 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.

    See more

    Declaration

    Swift

    public class TKWaypointRouter : NSObject
  • A trip classifier is used to classify TripGroup instances within the same TripRequest.

    What kind of classifications to use, is entirely up to the classifier - as long as they are NSObject instances taht conform to NSCoding.

    For examples see:

    See more

    Declaration

    Objective-C

    @protocol TKTripClassifier <NSObject>

    Swift

    protocol TKTripClassifier : NSObjectProtocol
  • Declaration

    Swift

    public class TKMetricClassifier : NSObject
    extension TKMetricClassifier: TKTripClassifier