Configuration

struct Configuration

Configuration of any TKUIRoutingResultsCard.

This isn’t created directly, but rather you modify the static instance accessible from TKUIRoutingResultsCard.config.

  • Set this to specify where the card should be placed when it’s loaded.

    Defaults to .peaking position

    Declaration

    Swift

    public var initialCardPosition: TGCardPosition
  • Set this to limit routing results to a certain transport modes.

    If this is set, the routing card will not display the Transport button, which allows users to show or hide transport modes when results are presented

    Defaults to nil, which means the SDK will read from TKSettings

    Declaration

    Swift

    public var limitToModes: Set<String>?
  • Set this to add a button for a trip group

    Called when a results card gets presented.

    Declaration

    Swift

    public var tripGroupActionFactory: ((TripGroup) -> TripGroupAction?)?
  • Set this to have a button on the results card to contact customer support when the user is encountering errors.

    Called when the user taps the button.

    Declaration

    Swift

    public var contactCustomerSupport: ((TKUIRoutingResultsCard, SupportType) -> Void)?
  • Set this to use your own map manager. You can use this in combination with TGCardViewController.builder to use a map other than Apple’s MapKit.

    Defaults to using TKUIRoutingResultsMapManager.

    Declaration

    Swift

    public var mapManagerFactory: (@MainActor (MKAnnotation?, Bool) -> TKUIRoutingResultsMapManagerType)
  • An optional list of autocompletion data providers. This list will be used by an instance of TKUILocationSearchViewController, which is presented when users click on the origin or destination labels. If none was provided, the TKAppleGeocoder and TKTripGoGeocoder will be used

    Declaration

    Swift

    public var autocompletionDataProviders: [TKAutocompleting]
  • Optional configuration of the time picker used on the routing results card Note: this will also be re-used in the mode-by-mode card

    Declaration

    Swift

    public var timePickerConfig: TKUITimePickerSheet.Configuration
  • Set this to select which trip metrics to show for each trip group in the routing results card.

    It is important to note that, while you may specify a trip metric to be shown, if such metric is unavailable in the response of the routing request, it will not be shown. In addition, the order specified here is the order in which the metrics will be displayed.

    This setting is independent of tripBadgesToShow.

    The default metrics to show are price, calories and carbon.

    Declaration

    Swift

    public var tripMetricsToShow: [TKTripCostType]
  • Set this to the allowed badges to show on a trip group

    Badges will only be shown if the related scores for that metric are sufficiently different for the trips.

    This setting is independent of tripMetricsToShow.

    By default all badges are shown.

    Declaration

    Swift

    public var tripBadgesToShow: Set<TKMetricClassifier.Classification>
  • Undocumented

    Declaration

    Swift

    public var customItemProvider: TKUIRoutingResultsCustomItemProvider?