TKSettings

Objective-C

@interface TKSettings : NSObject

+ (NSMutableDictionary *)defaultDictionary;

/**
 The maximum walking duration is a per-segment limit for mixed results, i.e., it does not apply to walking-only trips.
 
 @param duration Seconds
 */
+ (void)setMaximumWalkingDuration:(NSTimeInterval)duration;

/**
 The minimum transfer duration applies for trips with more than one public transport segment. It sets the minimum time that the user needs to arrive at every public transport segment after the first one.
 @param duration Seconds, which will get rounded up to the next minute.
 */
+ (void)setMinimumTransferDuration:(NSTimeInterval)duration;

/**
 Sets the profile weight for a specific component. Each component should be in the range of [0.1, 2.0], otherwise this is enforced server side. Weights of the components are relative to each other.
 @param weight New weight, preferably in range [0.1, 2.0]
 @param component The component for which to set this weight.
 */
+ (void)setProfileWeight:(float)weight forComponent:(TKSettingsProfileWeight)component;

/**
 @param speed The new walking speed. Slow is roughly 2km/h, average 4km/h, fast 6km/h.
 */
+ (void)setWalkingSpeed:(TKSettingsSpeed)speed;

/**
 @param speed The new cycling speed. Slow is roughly 8km/h, average 12km/h, fast 25km/h.
 */
+ (void)setCyclingSpeed:(TKSettingsSpeed)speed;

/**
 @param gramsCO2PerKm Emissions for supplied mode identifier in grams of CO2 per kilometre
 @param modeIdentifier Mode identifier for which to apply these emissions
 */
+ (void)setEmissions:(float)gramsCO2PerKm forModeIdentifier:(NSString *)modeIdentifier;

@end

Swift

class TKSettings : NSObject

Undocumented

  • Undocumented

    Declaration

    Objective-C

    + (NSMutableDictionary *)defaultDictionary;

    Swift

    class func defaultDictionary() -> NSMutableDictionary
  • The maximum walking duration is a per-segment limit for mixed results, i.e., it does not apply to walking-only trips.

    Declaration

    Objective-C

    + (void)setMaximumWalkingDuration:(NSTimeInterval)duration;

    Swift

    class func setMaximumWalkingDuration(_ duration: TimeInterval)

    Parameters

    duration

    Seconds

  • The minimum transfer duration applies for trips with more than one public transport segment. It sets the minimum time that the user needs to arrive at every public transport segment after the first one.

    Declaration

    Objective-C

    + (void)setMinimumTransferDuration:(NSTimeInterval)duration;

    Swift

    class func setMinimumTransferDuration(_ duration: TimeInterval)

    Parameters

    duration

    Seconds, which will get rounded up to the next minute.

  • Sets the profile weight for a specific component. Each component should be in the range of [0.1, 2.0], otherwise this is enforced server side. Weights of the components are relative to each other.

    Declaration

    Objective-C

    + (void)setProfileWeight:(float)weight
                forComponent:(TKSettingsProfileWeight)component;

    Swift

    class func setProfileWeight(_ weight: Float, forComponent component: TKSettingsProfileWeight)

    Parameters

    weight

    New weight, preferably in range [0.1, 2.0]

    component

    The component for which to set this weight.

  • Declaration

    Objective-C

    + (void)setWalkingSpeed:(TKSettingsSpeed)speed;

    Swift

    class func setWalking(_ speed: TKSettingsSpeed)

    Parameters

    speed

    The new walking speed. Slow is roughly 2km/h, average 4km/h, fast 6km/h.

  • Declaration

    Objective-C

    + (void)setCyclingSpeed:(TKSettingsSpeed)speed;

    Swift

    class func setCycling(_ speed: TKSettingsSpeed)

    Parameters

    speed

    The new cycling speed. Slow is roughly 8km/h, average 12km/h, fast 25km/h.

  • Declaration

    Objective-C

    + (void)setEmissions:(float)gramsCO2PerKm
        forModeIdentifier:(nonnull NSString *)modeIdentifier;

    Swift

    class func setEmissions(_ gramsCO2PerKm: Float, forModeIdentifier modeIdentifier: String)

    Parameters

    gramsCO2PerKm

    Emissions for supplied mode identifier in grams of CO2 per kilometre

    modeIdentifier

    Mode identifier for which to apply these emissions

  • Declaration

    Swift

    @objc
    public static var sortOrder: TKTripCostType { get set }
  • Determine whether two-way-hire vehicles, such as pod-based car-share, should ignore the cost of returning the car-hire vehicle to its pick-up location. By default this is set to false and the cost of returning the vehicle to its pick-up location will be added to all one-way trips. Set this to true if the cost of the trip should only include the cost that’s attributed to this trip and ignore the unavoidable additional cost for returning the vehicle to its pick-up location.

    Declaration

    Swift

    @objc
    public static var ignoreCostToReturnCarHireVehicle: Bool { get set }